Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
macro runs from keyboard, but not from macro button-why?
I created a macro to sort a table by column 2, which is filled with numbers.
I used the usual method of creating a macro - Word's macro "wizard" . The macro runs OK when executed via the keyboard shortcut I assigned. But if I create a macrobutton at the top of the column to run the same macro, it refuses to execute; when I double click on the macrobutton field, I get "Visual Basic Run Time error 9125 - String Passed Can't Be Parsed". How can a macro string execute perfectly from keyboard, but not from a macrobutton? Here's the 'problem' string that the wizard generated - does if offer any clues? Selection.Sort ExcludeHeader:=True, FieldNumber:="Column 2", SortFieldType _ :=wdSortFieldNumeric, SortOrder:=wdSortOrderAscending, FieldNumber2:="", _ SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:=wdSortOrderAscending _ , FieldNumber3:="", SortFieldType3:=wdSortFieldAlphanumeric, SortOrder3:= _ wdSortOrderAscending, Separator:=wdSortSeparateByCommas, SortColumn:= _ False, CaseSensitive:=False, LanguageID:=wdEnglishUS, SubFieldNumber:= _ "Paragraphs", SubFieldNumber2:="Paragraphs", SubFieldNumber3:= _ "Paragraphs" |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Text on Command Button gone in email | Microsoft Word Help | |||
macro produces error message | Microsoft Word Help | |||
Macros - Keyboard Commands | Microsoft Word Help | |||
Macro runs when opening a file | Microsoft Word Help | |||
Save As is not working due to macro security settings | Microsoft Word Help |