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!

Can't release Excel Object

Status
Not open for further replies.

BigRedTexas

Programmer
Mar 14, 2002
22
0
0
US
I have a simple ASP.NET app that launches an existing Excel workbook when the user clicks a button. However, the workbook never becomes visible (I set it to visible). And when I try to set the excel object to nothing, the excel object doesn't go way. When I try to call an application.quit() on the excel app, I get the following error:
Error #: 91 - Object reference not set to an instance of an object.

Can anyone tell me first of all why the Excel workbook is not showing up and why the Excel App is not being killed and removed from the Processes in Task Manager?

Thanks,
Scott
 
Hey Scott,

A friend of mine had the same problem: she wrote an app in vb6.0 that opened an Excel workbook, but although excel would load teh workbook wouldn't be visible. The only way to get it to view was to manually change the visible property within Excel itself.

I'll check with her and see if she found a work around for it.

As far as the quitting goes, I'm not sure about that one.
Are you testing this from a different pc than the one that has the asp.net code, or are you testing everything from the same pc?

Jack
 
Hey Scott, here's what my friend said:

Where you had the objWrkBook.Sheets(1).Visible = True
put objWrkBook.Sheets.Application.Windows.Item(1).Visible = True.

mind you, this is from a vb-desktop app point of view, but might still apply to what you're doing.

Jack
 
The sheet is not the problem. The actual application is what is not visible. Also, the application reference is never released, so it shows up in Task Manager. So, if I run the app 3 times, 3 instances of Excel show up in Task Manager and cannot be terminated.

Thanks,
Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top