Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Global Variables


I have a directory with about 20 excel files and want them to all shar
the same global variables once they are run. I was thinking of doin
this by creating a "vars.ini" file in the same directory and have the
all load the variables once opened. This way I can set the ini fil
once, and it would affect all the excel files equally. Is this
feasible approach?

Matt

--
mattsva
-----------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...fo&userid=3113
View this thread: http://www.excelforum.com/showthread.php?threadid=50815

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Global Variables

Should work. You can also put things in the registry. Check out XL VBA
help for the 'SaveSetting' statement. Don't forget to check the 'See also'
links from that page.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...

I have a directory with about 20 excel files and want them to all share
the same global variables once they are run. I was thinking of doing
this by creating a "vars.ini" file in the same directory and have them
all load the variables once opened. This way I can set the ini file
once, and it would affect all the excel files equally. Is this a
feasible approach?

Matts


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile:
http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=508150


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Global Variables

If you are talking about traditional global variables such as

Public MyVar

at the top of a module and you don't want to declare it at the top of the
module, then perhaps you could import a module with the declarations (a .bas
file - again this is nothing but a text file). If your talking about
declaring them, but initializing them by having your code opening an INI
file (which is nothing but a text file) and setting the values, then that is
feasible.

--
Regards,
Tom Ogilvy

"mattsvai" wrote in
message ...

I have a directory with about 20 excel files and want them to all share
the same global variables once they are run. I was thinking of doing
this by creating a "vars.ini" file in the same directory and have them
all load the variables once opened. This way I can set the ini file
once, and it would affect all the excel files equally. Is this a
feasible approach?

Matts


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile:

http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=508150



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Global Variables


Sounds good :)

Thanks Tom

--
mattsva
-----------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...fo&userid=3113
View this thread: http://www.excelforum.com/showthread.php?threadid=50815

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Global Variables

I have a class for reading an INI file if it is of interest to you I could
send you a copy... It will make what you are about to do "plug and play"...
--
HTH...

Jim Thomlinson


"mattsvai" wrote:


Sounds good :)

Thanks Tom!


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=508150


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
Global Variables Francis Brown Excel Programming 9 November 27th 05 06:14 PM
global variables [email protected] Excel Programming 3 November 16th 05 11:44 PM
Global variables - where do you place them? CRayF Excel Programming 16 September 28th 05 01:14 AM
Global Variables Ernst Guckel[_4_] Excel Programming 2 May 7th 05 11:10 PM
Global vs Local variables Ken Loomis Excel Programming 1 October 12th 04 05:03 AM


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