473,396 Members | 1,967 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,396 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 1483
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.