LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Set Class1Var = New Class1

Hello,
I'm wondering about using "Set Class1Var = New Class1".
This routine needs one occurance of that statement, but it doesn't
seem to hurt to execute it millions of times. (I know I could've said
Dim Class1Var as New Class1).

Q - What's going on when I execute that statement the 2nd, 3rd, etc.
time? TIA, D-C

Dim Class1Var As Class1

Sub Sub1()
Dim iLong&
' Set Class1Var = New Class1 ' once here
For iLong = 1 To 1000000000
' Set Class1Var = New Class1 ' many times here
Set Class1Var.WithEventsImg = UserForm1.Image1
Class1Var.WithEventsImg.Tag = Format$(iLong, "000,000,000")
If iLong Mod 10000 = 0 Then ' every once in awhile
StatusBar = Class1Var.WithEventsImg.Tag
DoEvents
End If
Next iLong
End Sub

'Class1 Module for reference
'Public WithEvents WithEventsImg As MSForms.Image
'Private Sub WithEventsImg_MouseDown( _
' ByVal Button As Integer, ByVal Shift As Integer, _
' ByVal X As Single, ByVal Y As Single)
' MsgBox WithEventsImg.Tag
'End Sub




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"