There may be another solution. I was experiencing a similar problem with Win32::OLE for excel after I migrated some scripts from a windows server 2003 to a windows 2008 server. I use Spreadsheet::WriteExcel to create a spreadsheet but as I want it in excel 2007 format (.xlsx) I use Win32::OLE to convert it from 2003 to 2007 format.
my $exc = Win32::OLE->new('Excel.Application','Quit') || die "could no +t start excel\n"; $exc->{Visible} = 0; #runs excel in the background $exc->{DisplayAlerts} = 1; my $book = $exc->Workbooks->Open("$path") || die ("Can't open file $pa +th ", Win32::OLE->LastError()); $book->SaveAs({FileName => "$convto", FileFormat => 51}) || die ("Can' +t save as file format ", Win32::OLE->LastError()); $book->Close(); $exc->Quit();
I did some searching and found that all I needed to do to fix is was to create the directory c:\windows\syswow64\config\systemprofile\desktop (or system32 instead of syswow64 on a 32 bit system). After I did that it all worked fine. Here's the posting I got that trick from:
http://social.msdn.microsoft.com/Forums/en-ZA/olbasics/thread/e437524b-412a-4ed3-9cf8-fb9afed7a7ad
Hope this helps!
In reply to Re^2: When not logged in, using Win32::OLE for Excel fails
by gdolph
in thread When not logged in, using Win32::OLE for Excel fails
by dana81
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |