> From: Beckett Richard-qswi266 [mailto:[EMAIL PROTECTED]] 
> Subject: RE: manipulating Excel


> I have two (silly) questions, already...

Nothing is silly if in the pursuit of knowledge.

> I have an excel file in the directory that the script is 
> running from, called results.xls, however I can't open it with:
> 
> my $Book = $Excel->Workbooks->Open("results.xls");
> 
> I have to use :
> 
> my $Book = $Excel->Workbooks->Open("d:\\perl\\my 
> scripts\\results.xls");
> 
> Is there a way around this, as when I ship my completed 
> script, the files will all be in the same dir, but that dir 
> is likely to vary, depending on where the user puts it?

If this is working as web script on IIS (I can't speak for others), then the
cwd will end up being the WEB SERVERS working directory.  I would suggest
including some code to apply the users environment info to the script,
either through an ini or settings text, command line, etc.



> Secondly, when the script exits, save and replace-file 
> dialogue boxes pop up. I have tried to disable these with:
> 
> $Excel->{DisplayAlerts}=0;
> 
> but the script does not make any changes to the spreadsheet. 
> It gives no warnings or errors, either. I tried replacing the 
> {} with (), but this gave an error.


hmm, try this instead:  

#my $vttrue =  Variant(VT_BOOL, 1);

my $vtfalse =  Variant(VT_BOOL, 0);
   $Excel->{DisplayAlerts}=$vtfalse;

HTH,

Chuck.
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to