"Bad Variable Type", Excel, W2K

Discussion in 'ASP .Net' started by Alfredo Magallón Arbizu, Jul 28, 2003.

  1. 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
     
    Alfredo Magallón Arbizu, Jul 28, 2003
    #1
    1. Advertising

  2. 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.
     
    Tian Min Huang, Jul 29, 2003
    #2
    1. Advertising

  3. 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!
     
    Alfredo Magallón Arbizu, Jul 29, 2003
    #3
  4. 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.
     
    Tian Min Huang, Jul 30, 2003
    #4
  5. 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" <> wrote in message
    news:...
    > 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.
    >
    >
     
    Alfredo Magallón Arbizu, Jul 30, 2003
    #5
  6. 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.
     
    Tian Min Huang, Aug 4, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Kilpatrick

    Re: ASP.NET problem after installing W2K SP4

    Alex Kilpatrick, Jul 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    372
  2. =?Utf-8?B?RGF2aWQgUmV5bm9sZHM=?=

    vb.net webform on 2000 returns "Bad variable type" for Excel

    =?Utf-8?B?RGF2aWQgUmV5bm9sZHM=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,754
    =?Utf-8?B?cGF1bF9leDI1MA==?=
    Mar 24, 2005
  3. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,512
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  4. Moran, Craig M (BAH)

    Using ole_free for Excel on W2K (Ruby 1.8.0-10)

    Moran, Craig M (BAH), Feb 10, 2004, in forum: Ruby
    Replies:
    1
    Views:
    108
    Osuka Adartse
    Feb 10, 2004
  5. J.Cottingim

    set Bad variable type - SNMP::Util set

    J.Cottingim, Jul 3, 2007, in forum: Perl Misc
    Replies:
    0
    Views:
    104
    J.Cottingim
    Jul 3, 2007
Loading...

Share This Page