Hello everybody,
I have implemented a windows form in C# .NET to export data from a listbox
to Excel. I work on a Windows XP machine with Office 97 and .NET framework
1.1 SDK installed. I use Visual Studio .NET 2003, German version, Service
Pack 1. The Excel Export works fine on my developement machine, but I
cannot export data into Excel on other computers.
I tried to run the program on 2 other machines. One is a Windows XP and the
other a Windows 2000 system. Both computers have MS Office 97 (the same
version as on the development machine) and .NET framework 1.1 SDK installed
and I have administrator rights.
I found out that the command:
Excel.Application oXL;
oXL = new Excel.ApplicationClass();
is passed without errors, but when I try to set or change any attributes of
Excel object, f.e.
oXL.Visible = false;
I get an exception saying "Error HRESULT: 0x8007FA08. Line: Interop.Excel
at Excel.ApplicationClass.set_Visible(Boolean RHS)\r\n"
I already read many postings for similar issues, but none of the solutions
worked for me:
I checked the rights of the ASP.NET user on both machines, the permissions
are same as on my developement machine. I also checked if maybe the culture
settings are incorrect (there is a Microsoft support article about that),
but my Visual Studio version is in German, my MS Office 97 is in German and
the computer's region settings are also set to German.
I even installed Visual Studio .NET on the Win2000 computer and compiled
the source files again on this machine, but I still get the same error.
Does anybody have any idea what causes this error or what else I can try ?
Thanks in advance,
Robert