View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default SET statement tutorial

if x = 1 then
set wrkbkurl1 = workbooks.open(filename:="P:\VBA training....\....xls")
elseif xl = 2
set wkrkburl2 = workbooks.open(filename:="yourother path here")
end if

Daminc wrote:

With regards to:
Set wrkbkUrl1 = Workbooks.open _
(filename:="P:\VBA training\Excel templates for Network stats\1
Network.xls")

can I attach a name (i.e. wrkbkUrl1) to a workbook without opening it?

I want to use it later on for example:

If x=1 then wrkbkUrl1.open
elseif
x=2 then wrkbkUrl2.open
end if

or something like that?

I though it might be :

Set wrkbkUrl1 = Workbooks(filename:="P:\VBA training\Excel templates
for Network stats\1 Network.xls")

but it doesn't work :(

--
Daminc
------------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=501108


--

Dave Peterson