Re: Excel 2008 problem getting started
Re: Excel 2008 problem getting started
- Subject: Re: Excel 2008 problem getting started
- From: Deivy Petrescu <email@hidden>
- Date: Wed, 10 Mar 2010 13:58:54 -0500
On 10/03/2010, at 13:21 , Gil Dawson wrote:
> I'm having a little problem getting started scripting Microsoft Excel 2008. I hope someone can point out what I'm missing.
>
> The following script works...
>
> set theExcelApp to "MBProHD:Applications:Microsoft Office 2008:Microsoft Excel.app"
> tell application theExcelApp
> activate
> end tell
>
> ...it activates Excel, as you might expect.
>
> But the following one does not...
>
> set theExcelApp to "MBProHD:Applications:Microsoft Office 2008:Microsoft Excel.app"
> tell application theExcelApp
> activate
> activate object workbook "2009 Electric Bills Charts V3.xls"
> end tell
>
> ...it gets a syntax error "Expected end of line, etc. but found identifier" with he word "workbook" highlighted.
>
> I've tried this pair of scripts with Smile and Script Editor, and I even even tried them with Excel 2004. They all do the same thing! This is right out of the book! What the bleep could be wrong?
>
> I'm using
>
> Microsoft® Excel® 2008 for Mac
> Version 12.2.4 (100205)
>
> AppleScript Editor
> Version 2.3 (118)
> AppleScript 2.1.1
>
> Smile 3.4.2
>
> Mac OS X 10.6.2
>
> MacBook Pro 2.53 GHz Intel Duo
> 4GB 1067 MHz DDR3
>
> I'd sure appreciate some help!
>
> --Gil _______________________________________________
Gil,
you do not say what do you want to do.
I am assuming that the workbook is opened and you want to bring it to the foreground.
This is what you do
tell application "Microsoft Excel"
activate
set window 1 to workbook "2009 Electric Bills Charts V3.xls"
end tell
If you use ***tell application "Microsoft Excel"*** it will bring the latest version.
You will need to specify only if you want to use an older version.
Deivy Petrescu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden