Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
BobW
 
Posts: n/a
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Text on Command Button gone in email SueKuKu Microsoft Word Help 3 May 8th 06 11:55 PM
macro produces error message Kimmie B Microsoft Word Help 11 March 14th 06 11:25 PM
Macros - Keyboard Commands Janet Microsoft Word Help 6 April 11th 05 05:28 AM
Macro runs when opening a file kharrison Microsoft Word Help 2 February 16th 05 04:29 AM
Save As is not working due to macro security settings Craig Meritz Microsoft Word Help 1 December 16th 04 03:53 AM


All times are GMT +1. The time now is 07:40 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"