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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with exporting datatable to excel 1

Status
Not open for further replies.

SarahVandenbroucke

Programmer
Mar 4, 2003
14
BE
Hi all,

I'm trying to export a datatable to an Excel file.

It all seems to be working fine, untill I'm trying to open the excel file with Excel.
I can open the file, but it only shows the title bar and menu. You can see the application behind excel through the spreadsheet area... But when you try to open it with Internet Explorer, it's no problem..

Anyone who has a solution for this?

Thanks.
Sarah
 
I had the same problem. If you look at the Windows Task Manager on the process tab, you'll notice the Excel.exe is still running. I was able to resolve this by using .net garbage collection ...and for some reason I had to do it twice. Just add this line at the end of your routine.

GC.Collect()

KJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top