C# - Excel Hangs When Opening Workbook

  • Thread starter Christopher Jones
  • Start date
C

Christopher Jones

Hello,

I have come across a very frustrating problem in attempting some Excel automation
with C#.

I have a bit of code that allows the user to select a spreadsheet to open
and then programmatically inserts some values into it.

For some reason, though, the code hangs during the call to open the workbook.
I am running this on a Windows 2000 SP3 Workstation w/Office 2000 and developing
the code on Windows XP with Office XP in Visual C#.NET. Incidentally, it
works flawlessly on my dev machine.

Here is the code I am using. It hangs on the 3rd line.

Excel.Application exapp = new Excel.ApplicationClass();
Excel.Workbook wb = exapp.Workbooks.Open(filename,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);

Does anyone have any ideas what this might be? I'm almost at my wits end
trying to figure out why it is hanging.

Thanks,
Chris Jones
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top