PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

workbooks.open function fails to open an existing excel file when used in ASP, but works in VB.

 
 
san
Guest
Posts: n/a
 
      3rd Jan 2006
Hi all,
The following script (asp code) works like a charm on my workstation
IIS


Dim objExcel
Dim objWorkBook
Set objExcel = CreateObject("EXCEL.APPLICATION")
Set objWorkBook = objExcel.Workbooks.Open("C:\test\test.xls")
objWorkBook.SaveAs ("C:\test\test2.xls")
objWorkBook.Close True
Set objWorkBook = Nothing
Set objExcel = Nothing


The code above is just a sample, the actual app is ASP and involves DB
access, reading/writing excel files, ...
Trying to narrow the scope I found out that the simple script above
does not work on the server, rather works fine on my workstation IIS.
(Note: My workstation also has IIS)
The test.xls file is the most simple XL file ever, and the path is OK
The NT account I use definitely has write permissions on the target
directory, and test2.xls does not exist when I run the script.

Excel is installed on the server and works normally when used as a
client app.
But it seems to fail miserabily when used as an activeX object. The
script above says it can't find the file, but both the directory and
the fiel definitely exist on the server.

Any ideas what could break / alter the way excel works when used as an
activeX object from another App/Script ?

Any comments welcome

Santhosh

 
Reply With Quote
 
 
 
 
Robin Hammond
Guest
Posts: n/a
 
      3rd Jan 2006
Just reading the script there doesn't seem to be anything wrong with it,
although you could make it objWorkbook.Close False (rather than true).

However, excel is definitely not recommended as a server side application.

I have had some success running the office web components as a server side
component although even this is not fully supported by MS. For simple
actions like the ones you are showing, the OWC may be a better route to go.
There is a lack of documentation on OWC, but most things will work as they
would in Excel, with a far smaller memory overhead and faster create/destroy
times.

Robin Hammond
www.enhanceddatasystems.com

"san" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
> The following script (asp code) works like a charm on my workstation
> IIS
>
>
> Dim objExcel
> Dim objWorkBook
> Set objExcel = CreateObject("EXCEL.APPLICATION")
> Set objWorkBook = objExcel.Workbooks.Open("C:\test\test.xls")
> objWorkBook.SaveAs ("C:\test\test2.xls")
> objWorkBook.Close True
> Set objWorkBook = Nothing
> Set objExcel = Nothing
>
>
> The code above is just a sample, the actual app is ASP and involves DB
> access, reading/writing excel files, ...
> Trying to narrow the scope I found out that the simple script above
> does not work on the server, rather works fine on my workstation IIS.
> (Note: My workstation also has IIS)
> The test.xls file is the most simple XL file ever, and the path is OK
> The NT account I use definitely has write permissions on the target
> directory, and test2.xls does not exist when I run the script.
>
> Excel is installed on the server and works normally when used as a
> client app.
> But it seems to fail miserabily when used as an activeX object. The
> script above says it can't find the file, but both the directory and
> the fiel definitely exist on the server.
>
> Any ideas what could break / alter the way excel works when used as an
> activeX object from another App/Script ?
>
> Any comments welcome
>
> Santhosh
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro fails when used to modify existing value CW Microsoft Access Macros 1 21st Jul 2008 03:56 PM
Report works but then fails when used as a Sub-Reportsource Brian Ronan Microsoft Access Reports 1 3rd Aug 2007 03:48 AM
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. shirdisanthosh@gmail.com Microsoft Excel Discussion 0 30th Dec 2005 09:28 AM
Open an existing excel speadsheet, opens Excel but not the file?? =?Utf-8?B?U21lZXRhIEdlYXJ5?= Microsoft Excel Misc 1 19th Sep 2005 03:28 PM
File open fails if the file is being used by another process =?Utf-8?B?T3Rpaw==?= Microsoft Dot NET 4 24th Jan 2005 07:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:04 PM.