Tuesday, January 23, 2018
  • Index
  •  » Automator
  •  » calling excel vba function from within automator-applescript

#1 2013-03-19 07:49:39 am

orionrush
Member
Registered: 2008-10-05
Posts: 31

calling excel vba function from within automator-applescript

Hello all

like it says on the tin Im trying to call an VBA function within an automator workflow. I'd like to be able to drag a spreadsheet onto the workflow and have it do its stuff. Im getting hung up on how to call the function from within the workflow without explicitly knowing the name of the workflow.


Applescript:


on run {input, parameters}
   tell application "Microsoft Excel"
       tell active workbook
           try
               evaluate "test_function()"
           end try
       end tell
   end tell
end run

http://support.microsoft.com/kb/184440 
The above support article gives the following

Applescript:


tell application "Microsoft Excel"
Activate
Evaluate "Workbook1!Test_Recording()"
end tell

what am I missing?
Thanks a lot for any thoughts.

Browser: Safari 537.11
Operating System: Mac OS X (10.8)


--
“In theory, theory and practice are the same. In practice, they are not.”
― Albert Einstein


Filed under: applescript, excel, Automator, vbs

Offline

 

#2 2013-03-21 12:18:00 pm

orionrush
Member
Registered: 2008-10-05
Posts: 31

Re: calling excel vba function from within automator-applescript

As near as I can tell this isn't actually possible. Automator wont process .xlsm files directly, only xlsx files (no macro) because it's a security risk.  It is possible from stand alone applescript, (which isn't a security risk?) just not from applescript called within automator.

It might be possible to get do it from a bash script using OSA - but I've not gotten that desperate (yet).

if anyone knows otherwise Im all ears! hmm


--
“In theory, theory and practice are the same. In practice, they are not.”
― Albert Einstein

Offline

 
  • Index
  •  » Automator
  •  » calling excel vba function from within automator-applescript

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)