Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ups.com... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I open an existing Excel spreadsheet in works? | Excel Discussion (Misc queries) | |||
How can I get existing Excel workbooks to open in separate windows | Excel Worksheet Functions | |||
Workbooks.open method fails | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
Open method of workbooks fails when Excel is hosted in IE | Excel Programming |