Problems with Longs in OWC11 SS

O

OWC

I have an ASP.Net applicatation that coded in VB.Net and uses the OWC11
spreadsheet component on the client and the server.

It all works fine on my development machine.

However, when I move it to another web server, I'm getting a few errors
dealing with the OWC on the server. The problems all revolve around the use
of Long datatypes. The problems occur on lines like:

oSS.Sheets(i).delete() ' Where the variable i is a Long

rangeUpperLeft.Offset(dataOffsetRow, dataOffsetColumn).Address ' Where
dataOffsetRow is a Long

These statements get the error message:

Run-time exception thrown : System.Runtime.InteropServices.COMException -
Bad variable type.

If I redefine the variables from Long to Integer, it works OK on both
servers. As far as I can tell, both servers are running the same version of
..Net framework, OWC11 and the OWC PIA's.

Using an Integer to index the Sheets collection is no problem (although its
still a curiosity why it would operate differently). However, I really need
to use a long for the second case since a worksheet can have more rows than
can be counted in an Integer.

TIA,

josh
 
V

Vitalik

Hi,

It appears to me that since VB.NET long data type is 64-bit int, OWC has
problems dealing with it. You already found your answer - use integer data
type (32-bit int). Its max value most likely will satisfy your needs.

Hope this helps.
Vitaliy


OWC said:
I have an ASP.Net applicatation that coded in VB.Net and uses the OWC11
spreadsheet component on the client and the server.

It all works fine on my development machine.

However, when I move it to another web server, I'm getting a few errors
dealing with the OWC on the server. The problems all revolve around the use
of Long datatypes. The problems occur on lines like:

oSS.Sheets(i).delete() ' Where the variable i is a Long

rangeUpperLeft.Offset(dataOffsetRow, dataOffsetColumn).Address ' Where
dataOffsetRow is a Long

These statements get the error message:

Run-time exception thrown :
System.Runtime.InteropServices.COMException -
 

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