473,416 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

"Bad Variable Type", Excel, W2K

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
Nov 17 '05 #1
5 3929
Hi Alfredo,

Generally speaking, the error happens when you have different versions of
Excel. If you referenced Excel 10.0 (Office XP) type library in windows
2003 server and then use the same program in a machine with Excel 2000, the
error happens. So please make sure that the version of Excel is the same.
If not, please add reference to the right type library in your program.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.

Nov 17 '05 #2
Excel is same version (XP SP2) in both servers.

Regards,
Alfredo

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
Hello Alfredo,

I noticed that you also post this issue to another newsgroup
"microsoft.public.office.developer.vba". One of my colleagues replied there
and I paste it here for your reference. Please let us know if the following
information helps you resolve the problem.

"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."

We are looking forward to your result!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
Nov 17 '05 #4
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

"Tian Min Huang" <ti******@online.microsoft.com> wrote in message
news:R2**************@cpmsftngxa06.phx.gbl...
Hello Alfredo,

I noticed that you also post this issue to another newsgroup
"microsoft.public.office.developer.vba". One of my colleagues replied there and I paste it here for your reference. Please let us know if the following information helps you resolve the problem.

"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."
We are looking forward to your result!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.

Nov 17 '05 #5
Hello Alfredo,

Thanks a lot for your update. I am very glad to hear that it works. In
addition, I believe the following KB article is very helpful:

INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/?id=257757

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
1
by: Gilles Arnaud | last post by:
Hello, I've got a nasty bug and no idea to deal with : here is the method : <method> def denormer(self, var) : " denorme un vecteur d'entree " try: #a = map(self.decerner, self.param, var)
7
by: ben | last post by:
hello, an algorithm book i'm reading talks about the connectivity problem/algorithm. it gives a number of examples where the connectivity problem applies to real life situations (like, the...
1
by: G Fernandes | last post by:
Hi, can someone tell me what the following words mean as per C/clc: 1) token 2) token sequence 3) scalar variable 4) vector
0
by: da20 | last post by:
Hi, I am using office xp, in my code i am referencing excel 10 library. When I am trying to open application i have following exception: "Old format or invalid type library". Please help. using...
2
by: David Reynolds | last post by:
Hi Everybody, I have a vb.net webform where I create the Excel application/workbook/worksheet. On Windows 2000 server for some reason, I keep getting an error("Bad variable type") when trying...
2
by: Lenonardo | last post by:
Hi. I'm writing a VB.Net application to update multiple Excel Worksheets. I'm using late binding (i.e. all variables are objects + use createobject) I develop the application on an XP...
4
by: octavio | last post by:
Hello members of the comp.lang.c newsgroup. Please I need you help on the following one. Compiling the simple code I'm getting this error message. Why ? Please what's the correct type of the fb...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.