On 11/20/2010 5:42 PM, John Connelly wrote:
Please ignore my last couple messages. I created another macro (which does exactly the same thing) and called it ExampleSpreadsheetMacro2. This time I saved it in the location you wanted it to be in. Attached is the spreadsheet with the macro... I hope :)

John


-----Original Message----- From: RA Brown
Sent: Saturday, November 20, 2010 4:38 PM
To: [email protected]
Cc: [email protected]
Subject: Re: [users] Re: reporting bug with openoffice calc

On Sat Nov 20 2010 14:43:09 GMT-0800 (PST)  John Connelly wrote:
My "Standard" folder was actually under "My Macros", not under "OpenOffice.org Macros". I'll attach a pic of this, just so you can see if mine is different that it is supposed to be. Anyway, the macro is named ExampleSpreadsheetMacro. When I right click on it, it does not give me an option to "copy" it as you suggested. How do I attach a macro (by itself) to an email? Sorry, I'm probably a lot less capable than your group.


To paste a copy get to the screen you took the shot of.  Highlight the
macro like in the shot.  Click the  Edit  button.  There you will see
the text that makes up the script.  Highlight the text, just like you
would in Writer, click on the Edit Menu then Copy.  Then paste that into
the message like this:

----------Start of script
sub Main
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$A$1:$F$20"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(7) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ByRows"
args2(0).Value = true
args2(1).Name = "HasHeader"
args2(1).Value = true
args2(2).Name = "CaseSensitive"
args2(2).Value = false
args2(3).Name = "NaturalSort"
args2(3).Value = false
args2(4).Name = "IncludeAttribs"
args2(4).Value = true
args2(5).Name = "UserDefIndex"
args2(5).Value = 0
args2(6).Name = "Col1"
args2(6).Value = 1
args2(7).Name = "Ascending1"
args2(7).Value = true

dispatcher.executeDispatch(document, ".uno:DataSort", "", 0, args2())


end sub

----- End of script

This I did by recording the macro as you suggested.  The only thing is I
do not now how to attach it the button.  But running this does as you
ask.  I see no problem with the cells not changing.

Andy


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
I believe the failure of the macro is not due to a bug in the program, but a failure of the recording process to record key steps, namely the selection of the columns to be sorted. To get a properly functioning macro you will need to construct one that explicitly selects only cols A & B, performs a sort, then selects only cols C & D, performs a sort, then selects only cols E & F, and performs a sort. This requires more fundamental knowledge than the Macro Recorder provides. Try Googleing "OOo Calc Macros".


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to