Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public variable (or Public Const?)
I have my main workbook called "1. FINANCE" with six sheets in it. About 10
other workbooks run off the main one doing diffrent tasks. I've set up a Public Variable in a normal module in PERSONAL.xls and set FINbk (whick is 1. FINANCE) and all of it's sheets such as F_PERS etc. This code works as it should, and the variables are set when FINbk opens, and are cleared when it closes. However, it seems to me that the Public Variables do not retain their values after a run of a few macros. Does that mean that I should be using a Public Const instead, and if so won't I get an error msg when I try to set it for the first time (1. FINANCE is the master name but when I do a run it has the client's surname attached "1. FINANCE Walkenbach.xls" Just wrapping my head around the whole Public thing (never did care much for the General Public :). Regards, Brett |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public variable (or Public Const?)
Refer the below URLs on Public/Const statements in VBScript
http://msdn.microsoft.com/en-us/libr...z8(VS.85).aspx http://msdn.microsoft.com/en-us/libr...ed(VS.85).aspx If this post helps click Yes --------------- Jacob Skaria "Brettjg" wrote: I have my main workbook called "1. FINANCE" with six sheets in it. About 10 other workbooks run off the main one doing diffrent tasks. I've set up a Public Variable in a normal module in PERSONAL.xls and set FINbk (whick is 1. FINANCE) and all of it's sheets such as F_PERS etc. This code works as it should, and the variables are set when FINbk opens, and are cleared when it closes. However, it seems to me that the Public Variables do not retain their values after a run of a few macros. Does that mean that I should be using a Public Const instead, and if so won't I get an error msg when I try to set it for the first time (1. FINANCE is the master name but when I do a run it has the client's surname attached "1. FINANCE Walkenbach.xls" Just wrapping my head around the whole Public thing (never did care much for the General Public :). Regards, Brett |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public variable (or Public Const?)
Hi Jacob, I read both of those but unfortunately none the wiser - I think
I've done everything that is suggested there. Is there something that I'm not catching? "Jacob Skaria" wrote: Refer the below URLs on Public/Const statements in VBScript http://msdn.microsoft.com/en-us/libr...z8(VS.85).aspx http://msdn.microsoft.com/en-us/libr...ed(VS.85).aspx If this post helps click Yes --------------- Jacob Skaria "Brettjg" wrote: I have my main workbook called "1. FINANCE" with six sheets in it. About 10 other workbooks run off the main one doing diffrent tasks. I've set up a Public Variable in a normal module in PERSONAL.xls and set FINbk (whick is 1. FINANCE) and all of it's sheets such as F_PERS etc. This code works as it should, and the variables are set when FINbk opens, and are cleared when it closes. However, it seems to me that the Public Variables do not retain their values after a run of a few macros. Does that mean that I should be using a Public Const instead, and if so won't I get an error msg when I try to set it for the first time (1. FINANCE is the master name but when I do a run it has the client's surname attached "1. FINANCE Walkenbach.xls" Just wrapping my head around the whole Public thing (never did care much for the General Public :). Regards, Brett |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public variable (or Public Const?)
THIS POST NO LONGER REQUIRED - I"M GOING TO REPOST
"Brettjg" wrote: Hi Jacob, I read both of those but unfortunately none the wiser - I think I've done everything that is suggested there. Is there something that I'm not catching? "Jacob Skaria" wrote: Refer the below URLs on Public/Const statements in VBScript http://msdn.microsoft.com/en-us/libr...z8(VS.85).aspx http://msdn.microsoft.com/en-us/libr...ed(VS.85).aspx If this post helps click Yes --------------- Jacob Skaria "Brettjg" wrote: I have my main workbook called "1. FINANCE" with six sheets in it. About 10 other workbooks run off the main one doing diffrent tasks. I've set up a Public Variable in a normal module in PERSONAL.xls and set FINbk (whick is 1. FINANCE) and all of it's sheets such as F_PERS etc. This code works as it should, and the variables are set when FINbk opens, and are cleared when it closes. However, it seems to me that the Public Variables do not retain their values after a run of a few macros. Does that mean that I should be using a Public Const instead, and if so won't I get an error msg when I try to set it for the first time (1. FINANCE is the master name but when I do a run it has the client's surname attached "1. FINANCE Walkenbach.xls" Just wrapping my head around the whole Public thing (never did care much for the General Public :). Regards, Brett |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Public variable (or Public Const?) | Excel Programming | |||
Public Const & RowSource | Excel Programming | |||
public const availability? | Excel Programming | |||
Public Const on a Drive | Excel Programming | |||
crash changing const to public const | Excel Programming |