473,385 Members | 1,645 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,385 software developers and data experts.

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

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
3 3852
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Karl Lang | last post by:
Hi I've created a new configuration section in Web.Config to hold the connection string for my database. If I have Option Strict On I get a message "Option Strict On disallows late binding" when I...
12
by: Simon Harris | last post by:
Hi All, I've been advised to use option strict. I've tried to read up on this, all i can find is that it... "disallows implicit narrowing conversions" This kinda makes sense - Means I have...
11
by: Dieter Schwerdtfeger via DotNetMonster.com | last post by:
I have this function where i search through my database for items that were made on a specific date. The line "CType(dvClubs.Item(teller).Item(veld).ToShortDateString" gives me the error : option...
3
by: Starbuck | last post by:
Hi The following generates an error when Option Strict is On Can anytell tell me how to get round this please. Private Sub optWithTone_CheckedChanged(ByVal eventSender As System.Object, ByVal...
4
by: Heinz | last post by:
Hi all, I use VB.net 2003 and want to export data to Excel. Target PCs still have Office 2000 so I could not use Microsofts PIAs. Instead I use the included Excel 10 COM DLL from Microsoft....
7
by: Owen Mortensen | last post by:
(This code was working in asp.net 1.1 VS2003. After upgrade to VS2005, chokes): in the aspx file: <ItemTemplate> <asp:datagrid id="dg_instr" runat="server" AutoGenerateColumns="False"...
1
by: Adotek | last post by:
Hi All, I've just converted a solution from .Net v1.1 to v2.0, by allowing Visual Studio 2005 to do the conversion. Since doing so, I am getting a compilation error as follows: "Option...
6
by: Rob | last post by:
I have employed a "Singleton mode" of programming for this project. I have a class that exposes some properties of the class "Sample" to other forms.... If I set Option Strict On, I get many...
7
by: Lynn | last post by:
Hello, I have a website that is working fine. I have just turned on "option strict" and am getting an error with the parts of my code. I have fixed everything but this section, which has me...
0
by: Ronald S. Cook | last post by:
Hi, I'm wanting to iterate over a generic IList, but the code won't compile because the blue sqiggle line under: _DataRow("SecurityFunctionName") = _IList(i).SecurityFunctionName; sez...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.