Clearing Excel format with Applescript

N

nic_m

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

Hi Folks,

I need to clear the format of all cells in a given worksheet as part of an applescript.

If i were to do this manually I would select all in the active sheet and the go to format cells and choose the number format general.

does any one know how to do this using applescript?

thanks in advance

nic
 
C

CyberTaz

I can't help you with the script, but it might be easier to use Edit> Clear>
Formats rather than going through the Format> Cells dialog.

HTH |:>)
Bob Jones
[MVP] Office:Mac
 
J

JE McGimpsey

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

Hi Folks,

I need to clear the format of all cells in a given worksheet as part of an
applescript.

If i were to do this manually I would select all in the active sheet and the
go to format cells and choose the number format general.

does any one know how to do this using applescript?

One way:

tell application "Microsoft Excel"
tell active sheet
clear range formats used range
end tell
end tell
 
N

nic_m

Thanks J.E. - that works well. Much better than using keystrokes.

I have to say that the available documentation for Excel and applescript has been somewhat lacking - so I really appreciate the help!

cheers

Nic
 
J

JE McGimpsey

Thanks J.E. - that works well. Much better than using keystrokes.

I have to say that the available documentation for Excel and applescript has
been somewhat lacking - so I really appreciate the help!

The guides on MacTopia aren't horrible, but I find that the dictionary
makes simple things pretty easy. Of course, it helps to have a good
familiarity with the Excel Object Model.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top