Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default How does Userform get initialized by this?

Trying to figure out how a Userform gets initialized.
Found that this line of code in a normal module:

strINIPath = strLocalDrive & ":\Test.ini"

Initializes this Userform.

strINIPath and strLocalDrive are Public variables, declared in a normal
module and these
variables are not used in this Userform.


I test like this:

Set MainForm = Nothing

On Error Resume Next
Msgbox MainForm Is Nothing

strINIPath = strLocalDrive & ":\Test.ini"

Msgbox MainForm Is Nothing

The second messagebox will give False.


Thanks for any insight in this.


RBS




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How does Userform get initialized by this?

If I had a userform named MainForm, then I received false for both message
boxes.

referencing a useform loads the userform.

To check if it is loaded, you have to loop through the userforms collection,
not check if it is nothing.

--
Regards,
Tom Ogilvy


"RB Smissaert" wrote in message
...
Trying to figure out how a Userform gets initialized.
Found that this line of code in a normal module:

strINIPath = strLocalDrive & ":\Test.ini"

Initializes this Userform.

strINIPath and strLocalDrive are Public variables, declared in a normal
module and these
variables are not used in this Userform.


I test like this:

Set MainForm = Nothing

On Error Resume Next
Msgbox MainForm Is Nothing

strINIPath = strLocalDrive & ":\Test.ini"

Msgbox MainForm Is Nothing

The second messagebox will give False.


Thanks for any insight in this.


RBS






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default How does Userform get initialized by this?

Just wondering why Mainform is not Nothing anymore after that line of code.
Maybe it is academic as I have no particular problem to solve, but just
trying to understand how this works.

RBS

"Tom Ogilvy" wrote in message
...
If I had a userform named MainForm, then I received false for both message
boxes.

referencing a useform loads the userform.

To check if it is loaded, you have to loop through the userforms
collection,
not check if it is nothing.

--
Regards,
Tom Ogilvy


"RB Smissaert" wrote in message
...
Trying to figure out how a Userform gets initialized.
Found that this line of code in a normal module:

strINIPath = strLocalDrive & ":\Test.ini"

Initializes this Userform.

strINIPath and strLocalDrive are Public variables, declared in a normal
module and these
variables are not used in this Userform.


I test like this:

Set MainForm = Nothing

On Error Resume Next
Msgbox MainForm Is Nothing

strINIPath = strLocalDrive & ":\Test.ini"

Msgbox MainForm Is Nothing

The second messagebox will give False.


Thanks for any insight in this.


RBS







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How does Userform get initialized by this?

for me it was not nothing before that line of code.

--
Regards,
Tom Ogilvy

"RB Smissaert" wrote in message
...
Just wondering why Mainform is not Nothing anymore after that line of

code.
Maybe it is academic as I have no particular problem to solve, but just
trying to understand how this works.

RBS

"Tom Ogilvy" wrote in message
...
If I had a userform named MainForm, then I received false for both

message
boxes.

referencing a useform loads the userform.

To check if it is loaded, you have to loop through the userforms
collection,
not check if it is nothing.

--
Regards,
Tom Ogilvy


"RB Smissaert" wrote in message
...
Trying to figure out how a Userform gets initialized.
Found that this line of code in a normal module:

strINIPath = strLocalDrive & ":\Test.ini"

Initializes this Userform.

strINIPath and strLocalDrive are Public variables, declared in a normal
module and these
variables are not used in this Userform.


I test like this:

Set MainForm = Nothing

On Error Resume Next
Msgbox MainForm Is Nothing

strINIPath = strLocalDrive & ":\Test.ini"

Msgbox MainForm Is Nothing

The second messagebox will give False.


Thanks for any insight in this.


RBS









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default How does Userform get initialized by this?

Did you do: Set MainForm = Nothing ?

RBS

"Tom Ogilvy" wrote in message
...
for me it was not nothing before that line of code.

--
Regards,
Tom Ogilvy

"RB Smissaert" wrote in message
...
Just wondering why Mainform is not Nothing anymore after that line of

code.
Maybe it is academic as I have no particular problem to solve, but just
trying to understand how this works.

RBS

"Tom Ogilvy" wrote in message
...
If I had a userform named MainForm, then I received false for both

message
boxes.

referencing a useform loads the userform.

To check if it is loaded, you have to loop through the userforms
collection,
not check if it is nothing.

--
Regards,
Tom Ogilvy


"RB Smissaert" wrote in message
...
Trying to figure out how a Userform gets initialized.
Found that this line of code in a normal module:

strINIPath = strLocalDrive & ":\Test.ini"

Initializes this Userform.

strINIPath and strLocalDrive are Public variables, declared in a
normal
module and these
variables are not used in this Userform.


I test like this:

Set MainForm = Nothing

On Error Resume Next
Msgbox MainForm Is Nothing

strINIPath = strLocalDrive & ":\Test.ini"

Msgbox MainForm Is Nothing

The second messagebox will give False.


Thanks for any insight in this.


RBS










Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Initialized ceemo[_23_] Excel Programming 4 August 30th 05 07:37 AM
Userform runs other subs when initialized zipdog Excel Programming 3 February 2nd 05 04:04 PM
ImageList must be initialized What-a-Tool Excel Programming 6 October 27th 04 12:39 AM
Excel: VBA userform is shown but not loaded/initialized even though it was first unloaded? Luisa[_2_] Excel Programming 2 December 5th 03 08:15 AM
listbox value not initialized John Holland Excel Programming 2 November 25th 03 07:57 PM


All times are GMT +1. The time now is 11:21 AM.

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

About Us

"It's about Microsoft Excel"