Is there a way to get generic application objects in Applescript that exist in Excel?

  • Thread starter gimme_this_gimme_that
  • Start date
G

gimme_this_gimme_that

For example ...

I'd like to translate this VBA macro:


Sub nn()
Workbooks.Open Filename:=Application.TemplatesPath + "Home
Essentials:Finance Tools:Car Lease vs Purchase"
End Sub


To Applescript:


tell application "Microsoft Excel"
set wkbk to open workbook file name TemplatesPath & "Home
Essentials:Finance Tools:Car Lease vs Purchase"
end tell

I can use the actual value of Application.TemplatePath to open the
file ... I'm mostly interested in knowing how to access Application
objects that I know are available via VBA that might not be
documented.

Thanks.
 
D

Dave Balderstone

For example ...

I'd like to translate this VBA macro:


Sub nn()
Workbooks.Open Filename:=Application.TemplatesPath + "Home
Essentials:Finance Tools:Car Lease vs Purchase"
End Sub


To Applescript:


tell application "Microsoft Excel"
set wkbk to open workbook file name TemplatesPath & "Home
Essentials:Finance Tools:Car Lease vs Purchase"
end tell

I can use the actual value of Application.TemplatePath to open the
file ... I'm mostly interested in knowing how to access Application
objects that I know are available via VBA that might not be
documented.

See <http://www.mactech.com/vba-transition-guide/>
 
G

gimme_this_gimme_that

Yeah, everyone and their brother is going to point to that article. It
probably does more harm than good. Don't get me wrong it's a good
article. But frankly it's not enough to get you started on Excel.
(One page devoted to working cell assignments on a range? Come on!)

Here is the trick (not in the article)

It turns out that template path is in the dictionary -

tell application "Microsoft Excel"
set wrkbk to open workbook workbook file name (get templates path) &
"Home Essentials:Finance Tools:Car Lease vs Purchase"
end tell
 

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