bassnsjp
06-10-2009, 06:53 AM
I'm using MS Office 2003 in an Windows XP Pro environment.
I'm developing an inventory set of macros. I have it working in a manner that requires manual intervention and want to integrate the modules together to automate the process. Now, in the process of integrating the modules I've declared variables that exist in more than one module as Public. I did so in the Main (master) module. However, when I go to use one of the variables in another module I get ambiguous name errors. Does Public delcaration really work, shouldn't I be able to reference the Public variable in any module within the same project? If I declare a variable once again as Public in the respective module(s) I don't get the error. Must I declare Public variables in every module? Thanks in advance for your assistance.
Public icnt as integer
Sub ABC()
icnt = icnt + 20
Call XYZ
end sub
Sub XYZ()
if icnt > 20 then
' do something
end if
end sub
Steve
I'm developing an inventory set of macros. I have it working in a manner that requires manual intervention and want to integrate the modules together to automate the process. Now, in the process of integrating the modules I've declared variables that exist in more than one module as Public. I did so in the Main (master) module. However, when I go to use one of the variables in another module I get ambiguous name errors. Does Public delcaration really work, shouldn't I be able to reference the Public variable in any module within the same project? If I declare a variable once again as Public in the respective module(s) I don't get the error. Must I declare Public variables in every module? Thanks in advance for your assistance.
Public icnt as integer
Sub ABC()
icnt = icnt + 20
Call XYZ
end sub
Sub XYZ()
if icnt > 20 then
' do something
end if
end sub
Steve