Group:  Microsoft Excel » microsoft.public.excel.sdk
Thread: Problem in Excel Saveas Method in windows 2008 server

Geek News

Problem in Excel Saveas Method in windows 2008 server
"Pankaj Jain" <pankaj[ at ]nagarro.com> 12/12/2008 6:42:10 AM
In one the web sites which we have developed, i'm creating an excel file
from C#.Net 2003-ASP.NET 1.1 application.

In my local machine which runs on Windows 2003 server the application works
perfectly, but when I try to run

the application in windows 2008 server machine it throws an exception at

Exception from HRESULT: 0x800A03EC. - Microsoft.Office.Interop.Excel - at
Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename, Object
FileFormat, Object Password, Object WriteResPassword, Object
ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
TextVisualLayout, Object Local)


We have MS office 2003 installed on the windows 2008 machine.

Regards,
Pankaj Jain


Re: Problem in Excel Saveas Method in windows 2008 server
Simon Murphy <tobinsm[ at ]codematic.net> 12/12/2008 9:06:28 AM
Which user are your running under on the 2008 box?
Does it have the rights to save to the location?

Cheers
Simon
Excel development website: www.codematic.net


Pankaj Jain wrote:
[Quoted Text]
> In one the web sites which we have developed, i'm creating an excel file
> from C#.Net 2003-ASP.NET 1.1 application.
>
> In my local machine which runs on Windows 2003 server the application works
> perfectly, but when I try to run
>
> the application in windows 2008 server machine it throws an exception at
>
> Exception from HRESULT: 0x800A03EC. - Microsoft.Office.Interop.Excel - at
> Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename, Object
> FileFormat, Object Password, Object WriteResPassword, Object
> ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
> Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
> TextVisualLayout, Object Local)
>
>
> We have MS office 2003 installed on the windows 2008 machine.
>
> Regards,
> Pankaj Jain
>
>
Re: Problem in Excel Saveas Method in windows 2008 server
Chris <chris[ at ]chrisbird.com> 12/12/2008 10:02:54 AM
I would seriously reconsider the architecture of your ASP.NET
application - IMHO loading a large process like Excel into memory and
then accessing it from the web-server via COM is a recipe for
disaster. Consider:

* All calls from all web-pages (on potentially many threads) to
generate the Excel file or access Excel will be serialized. You are
creating a massive bottleneck in your web application.

* You may need to configure COM out-of-process security - this can be
tricky to get right.

* Using Excel in this way to simply generate an output is not
efficient - there are better tools for the job.

Consider using:

http://www.carlosag.net/Tools/ExcelXmlWriter/

This creates Excel XML files, which although bulky are generated
quickly and can be made to look good.

or

http://blog.brezovsky.net/en-text-38.html

use the JET OLE DB Drivers to write a .csv or .xls file - just be
careful if you are targetting 64-bit windows, as some of the drivers
are not available.

or

http://www.bytescout.com/bytescoutxls_first_steps_with_asp_net.html

one of many commercial products.


Again, strongly, strongly advise against using Excel from a web
application.


On Dec 12, 6:42 am, "Pankaj Jain" <pan...[ at ]nagarro.com> wrote:
[Quoted Text]
> In one the web sites which we have developed, i'm creating an excel file
> from C#.Net 2003-ASP.NET 1.1  application.
>
> In my local machine which runs on Windows 2003 server the application works
> perfectly, but when I try to run
>
> the application in windows 2008 server machine it throws an exception at
>
> Exception from HRESULT: 0x800A03EC. - Microsoft.Office.Interop.Excel - at
> Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename, Object
> FileFormat, Object Password, Object WriteResPassword, Object
> ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
> Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
> TextVisualLayout, Object Local)
>
> We have MS office 2003 installed on the windows 2008 machine.
>
> Regards,
> Pankaj Jain

Re: Problem in Excel Saveas Method in windows 2008 server
Simon Murphy <tobinsm[ at ]codematic.net> 12/12/2008 10:49:40 AM
I totally agree Chris - I'm kicking myself for not mentioning it. MS
strongly discourage you from using Excel on a server. It's designed as
an interactive client app and there is every chance it will throw up a
modal dialog on the server and lock your whole process.

That said, plenty of people do it, but it needs plenty of handholding.
We had a whole queueing, monitoring and restarting wrapper. And someone
had to log into the server regularly for restarts and reboots.

Excel Services is Microsoft's preferred approach to expose complex
spreadsheets.

Cheers
Simon
Excel development website: www.codematic.net


Chris wrote:
[Quoted Text]
> I would seriously reconsider the architecture of your ASP.NET
> application - IMHO loading a large process like Excel into memory and
> then accessing it from the web-server via COM is a recipe for
> disaster. Consider:
>
> * All calls from all web-pages (on potentially many threads) to
> generate the Excel file or access Excel will be serialized. You are
> creating a massive bottleneck in your web application.
>
> * You may need to configure COM out-of-process security - this can be
> tricky to get right.
>
> * Using Excel in this way to simply generate an output is not
> efficient - there are better tools for the job.
>
> Consider using:
>
> http://www.carlosag.net/Tools/ExcelXmlWriter/
>
> This creates Excel XML files, which although bulky are generated
> quickly and can be made to look good.
>
> or
>
> http://blog.brezovsky.net/en-text-38.html
>
> use the JET OLE DB Drivers to write a .csv or .xls file - just be
> careful if you are targetting 64-bit windows, as some of the drivers
> are not available.
>
> or
>
> http://www.bytescout.com/bytescoutxls_first_steps_with_asp_net.html
>
> one of many commercial products.
>
>
> Again, strongly, strongly advise against using Excel from a web
> application.
>
>
> On Dec 12, 6:42 am, "Pankaj Jain" <pan...[ at ]nagarro.com> wrote:
>> In one the web sites which we have developed, i'm creating an excel file
>> from C#.Net 2003-ASP.NET 1.1 application.
>>
>> In my local machine which runs on Windows 2003 server the application works
>> perfectly, but when I try to run
>>
>> the application in windows 2008 server machine it throws an exception at
>>
>> Exception from HRESULT: 0x800A03EC. - Microsoft.Office.Interop.Excel - at
>> Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename, Object
>> FileFormat, Object Password, Object WriteResPassword, Object
>> ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
>> Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
>> TextVisualLayout, Object Local)
>>
>> We have MS office 2003 installed on the windows 2008 machine.
>>
>> Regards,
>> Pankaj Jain
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net