"Bad Variable Type", Excel, W2K

  • Thread starter Alfredo Magallón Arbizu
  • Start date
A

Alfredo Magallón Arbizu

Hi,

I have an ASP.NET app that works perfectly in Windows Server 2003, but fails
in Windows 2000.

It fails when trying to read the data in an Excel Workbook (range.value)...
The error is:

COMException (0x80020008): Bad Variable Type

The app works in Windows Server 2003 !!!

Why it fails in Windows 2000... Any idea???

Thanks,
Alfredo
 
J

Jim Vita

Alfredo,

I found a case that describes similar symptoms to those you are seeing.
Please check the following:

1) Excel is installed on the Windows 2000 machines. Excel.exe is an
out-of-process server and has to be installed on the machines on which you
wish to automatic. The Excel version must match that refernced in your
program or you will receive interface mismatch errors.
2) Check that the expression you are building to access the range matches
the data type expected. In a previous case

xlSheet.Cells(i + 4, 1).Value = "Test Value" produced the same error
because i was declared as long and is expected to be integer.

If this information doesn't fix your problem, please feel free to post the
following information:

1) A snipet of the failing code
2) OS and Excel versions in the various environments
3) Whetther you are using VB or C#

Thanks,

Jim

Jim Vita
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alfredo Magallón Arbizu

I changed range access variables from long to integer, and it works now !!!

Anyway, I consider this a very limiting issue and a bug to be corrected, as
it is if I use Windows Server 2003.

Many thanks for your help!!!

Alfredo
 
J

Jim Vita

Alfredo,

Glad to help and good luck!

Thanks,

Jim

Jim Vita
Microsoft Developer Support

Microsoft Security Announcement: Have you installed the patch for Microsoft
Security Bulletin MS03-026? If not Microsoft strongly advises you to review
the information at the following link regarding Microsoft Security Bulletin
MS03-026 http://www.microsoft.com/security/security_bulletins/ms03-026.asp
and/or to visit Windows Update at http://windowsupdate.microsoft.com to
install the patch. Running the SCAN program from the Windows Update site
will help to insure you are current with all security patches, not just
MS03-026.

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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