I ran your code, and I am able to open the file in NT with no problems. I tried:
- Open Excel, open file from menu (and tool bar). OK
- Double-click on file in folder. OK
- Move file to desktop, double-click. OK
- Drag file onto Excel icon to open. OK
I'm running NT4 SP4 with Office 97, so I don't know how your specific setup differs. Since it seems to work for me, my best guess would be that somehow something's goofy with your Excel setup. I know that file associations and such get mangled at random. If you have more specific errors, maybe I can test some more.
Update: Somehow I missed the last two lines in your test script. Adding those lines makes goofy stuff happen. I get these errors:
retrying default method at D:/Perl/site/lib/Win32/OLE/Lite.pm line 156
+.
Can't call method "Add" on an undefined value at D:/Perl/site/lib/Exce
+l
36.
retrying default method at D:/Perl/site/lib/Win32/OLE/Lite.pm line 156
+.
retrying default method at D:/Perl/site/lib/Win32/OLE/Lite.pm line 156
+.
Also, I get an Excel prompt asking if I would like to save "Book1". I've tried saying yes and no, but I get the same output - none. For some reason, neither .xls file is created.
If I have Excel running then run the script, both files are created and they're loaded right into Excel. Strange.
GuildensternNegaterd character class uber alles!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.