Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd like to declare a workbook and a worksheet before the first
procedure so that all other procedures can use them. When I tryied to use Set Statement as "Set myBook = Workbooks("test.xls")", I've got "invalid outside of a procedure" error. So, I guessed the Set statement may not work outside of a procedure (I'm not sure). And then, I declared a string constant as "Public Const myBook as "test.xls"" and used myBook in other procedure as "Workbooks(myBook)", which worked fine. However, I'd like to use something like myBook.mySheet.myRange.---, insted of Workbooks("myBook").Worksheets("mySheet").Range("m yRange").---, Any recommendation? Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Declare and Set Public variables | Excel Discussion (Misc queries) | |||
Declare a public variabl | Excel Programming | |||
Public declare for Set.... | Excel Programming | |||
How to declare variable as public. | Excel Programming | |||
PUBLIC DECLARE | Excel Programming |