Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Automation works in Office 2003 but not Office 2007

Status
Not open for further replies.

AndyH1

Programmer
Jan 11, 2004
350
GB
have some Excel automation which works fine when using Office 2003. In the web.config it has

<add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>

I'm running on win 2003 server. When the customer put the system on their site they installed Office 2007. I changed the reference to Excel 12 using Visual Studio and it changed this line too

<add assembly="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>

The web site built fine, and I checked permissions on Excel etc were the same (Network service and ASP.net), but I keep getting the error below:

The reports folder has write permission and theres plenty of memory both on disk and RAM so I cannot understand what is going wrong. Can anyone advise:

Thanks
Andy
 
You forgot to include the exception message (you should also include type and stack trace). Have you googled the type and message yet? that is the best place to start. also search MSDN site.

this is a website/app, if the site is trying to access files outside the virtual directory there will be permission issues.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Woops, sorry Jason, your right, forgot to put the exception.

The error its throwing is:

Source Error:

Line 20: Dim xlWorkBook As Excel.Workbook
Line 21: Dim xlWorkSheet As Excel.Worksheet
Line 22: xlWorkBook = New Excel.Application().Workbooks.Add(Missing.Value)
Line 23: xlWorkBook.Application.Visible = True
Line 24: xlWorkSheet = xlWorkBook.ActiveSheet

Source File: C:\Inetpub\ Line: 22

Stack Trace:

[COMException (0x800a03ec): Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space.

• To make more memory available, close workbooks or programs you no longer need.

• To free disk space, delete files you no longer need from the disk you are saving to.]
Microsoft.Office.Interop.Excel.Workbooks.Add(Object Template) +0
SharedCode.ExcelReportGeneration.GenerateExcelReportWithTotals(DataSet dsData, Int32 SortColumn, Int32 TotalColumn, String DateColumns, String MoneyColumns, String FileName, String SavePath, Boolean AutoFilter) in C:\Inetpub\ _Default.btnGenerateSpendReport_Click(Object sender, EventArgs e) in C:\Inetpub\ System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
 
start here. It could be that this exception is swallowing another exception which is related to file access rather than disk/memory space.


Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks Jason, but I did try looking on the web before trying this forum and tried google (pretty much with the same search you put). Most of the items that came up were people having the same problem as me, but very little in the way of answers.

The only thing suggested seem to be

1. Check youv'e given the IIS_WPG group or ASP.NET worker process MODIFY permission on the Reports folder and ensure ASP.Net Impersonation is enabled in IIS Option

Set permission in dcomcnfg

Both of these I'd already done so didn't seem to be any solution unfortunately. kind of stuck for ideas now
Thanks
Andy
 
where are the xls files located?
1. within the directory
2. local box but different directory
3. remote machine?

if it's 1 or 2 then you need to adjust the permissions of the account accessing the files.
if it's 3 then you need to configure delegation between the IIS box and the remote box. This is done in AD.
Open AD
browse to the IIS computer
right click and view properties
open the Delegation tab
Enable delegation

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top