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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.