#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Type Scope

To all,

I created a Public Type in a module as follows,

Public Type AppInfo
UserAction As String
FolderSelected As String
DBFolder As String
DBFn As String
End Type

A procedure in the module shows a form and I fill appInfo
values, but when I unload the form the values are lost?

Why is that?

Jim



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Type Scope

Jim,

Where are you declaring the variable of the specified Type? If
you declare the variable in the form's code, it will be lost when
the form is unloaded. If it is declared in the same procedure
that shows the form, it will remain in scope for that procedure.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jim" wrote in message
...
To all,

I created a Public Type in a module as follows,

Public Type AppInfo
UserAction As String
FolderSelected As String
DBFolder As String
DBFn As String
End Type

A procedure in the module shows a form and I fill appInfo
values, but when I unload the form the values are lost?

Why is that?

Jim





  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Type Scope

It is declared in the Module that contains a Sub that
shows the Form. That's why I'm confused.

Jim




-----Original Message-----
Jim,

Where are you declaring the variable of the specified

Type? If
you declare the variable in the form's code, it will be

lost when
the form is unloaded. If it is declared in the same

procedure
that shows the form, it will remain in scope for that

procedure.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jim" wrote in

message
...
To all,

I created a Public Type in a module as follows,

Public Type AppInfo
UserAction As String
FolderSelected As String
DBFolder As String
DBFn As String
End Type

A procedure in the module shows a form and I fill

appInfo
values, but when I unload the form the values are lost?

Why is that?

Jim





.

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
Name scope within a workbook Christer Excel Discussion (Misc queries) 0 March 24th 10 10:32 PM
Name Scope Slim Slender[_2_] Excel Worksheet Functions 2 December 16th 09 01:38 AM
Scope of name Slim Slender Excel Discussion (Misc queries) 0 December 13th 09 10:01 PM
Range Name Scope Gee Excel Discussion (Misc queries) 4 September 22nd 09 01:32 PM
Change scope of a name hmm Excel Discussion (Misc queries) 0 October 30th 08 02:36 PM


All times are GMT +1. The time now is 01:13 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"