in reply to Script works on WinXp & win98 but not Win2000

Thanks for adding some detail.

You need to add some more error-checking. I suspect that your $Excel object never gets created right. You can do something like this after creating it:

$Excel or die "Excel object not created\n";
If you get that error, you have an Excel COM-object registration problem.

The other issue is that the file and path to the workbok are hard-coded, and you don't check for file existance before opening it. Add this before opening the file:

die "Missing excel Workbook" unless -e "D:\\andreas\\perl\\squash.xls +";
You should also check the contents of the form, and complain to the user if they are empty. This is not just for "user friendly"-ness - it can also help diagnose cases where your script is called from an unexpected place, without passing form info.

This is just a start toward writing "good" code - there are several other programming technequies in your code that need improvement - this is just enough info to get you started.

Replies are listed 'Best First'.
Re: Re: Script works on WinXp & win98 but not Win2000
by Anonymous Monk on Oct 11, 2003 at 20:21 UTC
    Thank you NetWallah and Inman. I really appreciate the help. I will add some more error-trapping and see where the problem is arising and try to sort through this. I imagine I also have to set the permissions as Inman mentioned so I'll have to sit down with my buddy and sort out his computer early next week. Thanks, Andreas