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.


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


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)

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! :confused: