By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,727 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,727 IT Pros & Developers. It's quick & easy.

Option Strict On Disallows Late Binding -- What to do?

P: n/a
DK
This particular area of the program builds a Excel spreadsheet for the
user to manipulate further. After turning Option Strict On and
correcting everything I can the following line remains -- any ideas
how to reconstruct this so it doesn't think its a late bound object?

xlWS.Cells(row, col).value = ObjColumn.HeaderOne & " " &
ObjColumn.HeaderTwo

XLWS is defined as an Excel.Worksheet and xlWS.Cells(row,col).value
apears to be late bound -- what do I need to use in place of this?

Nov 14 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
CMM
Try to caste the Cells(...) call into the object type you expect (a Range?).
CType(xlWS.Cells(row, col), Excel.Range).value=...
Or something like that.

"DK" <dw*****@ermco-eci.comwrote in message
news:11**********************@v2g2000hsf.googlegro ups.com...
This particular area of the program builds a Excel spreadsheet for the
user to manipulate further. After turning Option Strict On and
correcting everything I can the following line remains -- any ideas
how to reconstruct this so it doesn't think its a late bound object?

xlWS.Cells(row, col).value = ObjColumn.HeaderOne & " " &
ObjColumn.HeaderTwo

XLWS is defined as an Excel.Worksheet and xlWS.Cells(row,col).value
apears to be late bound -- what do I need to use in place of this?
Nov 14 '07 #2

P: n/a
DK,

The way I would do it, was using the intelligence, as xlWS is correct then
it will give after the dot what you can use.

In other words, type it over again.

If there then is something that is not in your intelligence, then you have
to (direct)cast it, to a "type" that contain then what you are using.

Cor

Nov 14 '07 #3

P: n/a
DK
On Nov 14, 12:53 pm, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
DK,

The way I would do it, was using the intelligence, as xlWS is correct then
it will give after the dot what you can use.

In other words, type it over again.

If there then is something that is not in your intelligence, then you have
to (direct)cast it, to a "type" that contain then what you are using.

Cor
Agreed but it looks nasty:
xlWS.Range(xlWS.Cells(row, col), xlWS.Cells(row, col)).Value =
ObjColumn.HeaderOne & " " & ObjColumn.HeaderTwo

Nov 15 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.