C
Chris66
Guest
I have a VBA module that I need to reference a file path 3 or 4 times in the module. Is there a way that I can make define the path as a varible and then reference the variable?
Instead of typing:F\dept\matl\Leb\file name.xls, can I define a variable to be equal to the path such as
Path = F\dept\matl\Leb\file name.xls
then in the coding just use Path in place of F\dept\matl\Leb\file name.xls.
I tried using:
Dim path as object
set path = F\dept\matl\Leb\file name.xls
But I got a Compile Error: Type Mismatch I have to copy this module over 200 times and change the file name on every copy, I would really like to just go to the top of the code and change the file name once and be done. Any help would be appreaciated.
Instead of typing:F\dept\matl\Leb\file name.xls, can I define a variable to be equal to the path such as
Path = F\dept\matl\Leb\file name.xls
then in the coding just use Path in place of F\dept\matl\Leb\file name.xls.
I tried using:
Dim path as object
set path = F\dept\matl\Leb\file name.xls
But I got a Compile Error: Type Mismatch I have to copy this module over 200 times and change the file name on every copy, I would really like to just go to the top of the code and change the file name once and be done. Any help would be appreaciated.