Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Using Win32::OLE and Excel - Tips and Tricks

by jrsimmon (Hermit)
on Aug 11, 2009 at 20:46 UTC ( [id://787765]=note: print w/replies, xml ) Need Help??


in reply to Re: Using Win32::OLE and Excel - Tips and Tricks

This exception
OLE exception from "Microsoft Office Excel" 'SLOC_Count_C_Sharp_Macro' could not be found. Check the spelling of the file name, and verify the file location is correct tells me that the string
"Personal.xls!SLOC_Count_C_Sharp_Macro" is not meaningful to Win32::OLE, or is simply incorrect.

I'm not sure that win32::ole allows you to run a macro from a workbook that you haven't opened. Have you tried this:

my $macroExcel = Win32::OLE::Strict->new('Excel.Application') or die; my $macroBook = $macroExcel->Workbooks->open($myPersonalMacros) or die +; $macroExcel->run("SLOC_Count_C_Sharp_Macro");

And please, please, read How do I compose an effective node title?, How do I post a question effectively?, and Markup in the Monastery!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://787765]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2025-02-17 00:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found