473,387 Members | 3,750 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,387 software developers and data experts.

late binding error

Is there any way to avoid the late binding error in this code snippet? Opton
Strict ON
Public Sub ComboBoxFlatClearForEdit(ByRef obj As Object)

Dim objControl As New Control

For Each objControl In obj.Controls ' (LATE BINDING ERROR)

ComboBoxFlatEmpty(objControl)

Next

End Sub

Thanks,

Dean Slindee

Nov 21 '05 #1
3 1482
"Dean Slindee" <sl*****@charter.net> schrieb:
Is there any way to avoid the late binding error in this code snippet?
Opton
Strict ON
Public Sub ComboBoxFlatClearForEdit(ByRef obj As Object)
'ByRef obj As Object' => 'ByVal obj As Control'.
Dim objControl As New Control
Remove the 'As New Control', it doesn't make sense here.
For Each objControl In obj.Controls ' (LATE BINDING ERROR)


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
can you give more information please -- what is obj?

Nov 21 '05 #3
Recoded as below and now is not a late bind. The change is to say "ByRef
obj As Control"
Public Sub ComboBoxFlatClearForEdit(ByRef obj As Control)

Dim ctl As New Control

For Each ctl In obj.Controls

ComboBoxFlatEmpty(ctl)

Next

End Sub

"Dean Slindee" <sl*****@charter.net> wrote in message
news:xD*******************@fe04.lga...
Is there any way to avoid the late binding error in this code snippet? Opton Strict ON
Public Sub ComboBoxFlatClearForEdit(ByRef obj As Object)

Dim objControl As New Control

For Each objControl In obj.Controls ' (LATE BINDING ERROR)

ComboBoxFlatEmpty(objControl)

Next

End Sub

Thanks,

Dean Slindee

Nov 21 '05 #4

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

Similar topics

1
by: vMike | last post by:
If I try to get the tooltip and name of the image object that triggers the image button onclick event I get a late binding error. I can turn off option strict but is there any other way to get this...
2
by: VB Programmer | last post by:
I have an arraylist which holds a custom structure I made. (The structure contains FirstName, LastName, Address and EmpId.) I am trying to loop through the arraylist to write out each item. ...
5
by: eBob.com | last post by:
In another thread VJ made me aware of Tag. Fantastic! I've been wanting this capability for a long time. But it seems that I cannot use it with Option Strict On. In an event handler I have ......
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
1
by: Dean Slindee | last post by:
Can someone explain how to remedy the two late binding errors below when Option Strict On: Public Function ControlDataRowArrayListPaint(ByRef frm As Form, _ ByRef ctl As Control, _ ByRef...
2
by: Dean Slindee | last post by:
Can someone explain how to remedy the two late binding errors below when Option Strict On: Public Function ControlDataRowArrayListPaint(ByRef frm As Form, _ ByRef ctl As Control, _ ByRef dr...
2
by: Dean Slindee | last post by:
Notice the one 'LATE BINDING ERROR line at the bottom, the rest of the code is just the context. How can this one line be coded to comply with Option Strict ON? '== Calling form...
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....
2
by: GS | last post by:
I have installed the ms PIA for ofc XP, and followed the article http://support.microsoft.com/kb/247412/ trying to paste into a worksheet However I got late binding not allowed errors .......
14
by: Siv | last post by:
hi, I am converting an application that writes to an Excel spreadsheet and the code trips the "option Strict" that I would like on because the parser says "option Strict On disallows late...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.