I have a procedure that runs a PERL script through xp_cmdshell. The PERL script opens Excel and has Excel open a document so that it can parse through it.
When I run the PERL script directly from the command line, it works perfectly.
When I run it from xp_cmdshell I get the following error:
Win32::OLE(0.1502) error 0x800a03ec in METHOD/PROPERTYGET "Open" at c:\perl\excel\TestRead.pl line 10
Now I initially thought that this was a simple permissions problem, but the account that xp_cmdshell uses has full permissions on the directory the file's in and to the Excel application. Wierder still, I can use PERL to read and write files to my heart's content. I just can't use the OLE Excel object to open an Excel file.
Anyone encounter something like this before? I think the fact that it's PERL is coincidental. The issue is that I can't use the Win32 Excel.Application object to open Excel files when using xp_cmdshell to do so. Remember, this works when I run it from the command line.
Sorry, no apostrophe. In fact, I've tried this with several files, the most recent of which is simply "test.xls". The is the kind of problem that makes my brain hurt. Has anyone encountered this before?
Hmmm...As much as I admire and enjoy Perl, I think that for Win32 objects it is poorly documented and buggy...whenever I run into this kind of issue, I find it best to resort (grudgingly) to using VBScript. Sorry.