hi Goaliemenace
Here are two examples of how you can set a variable to be a workbook.
The first is when you open an existing file & the second is if you are
create a file...
VBA Code:
--------------------
Option Explicit
Sub Macro2()
Dim Createdwb As Workbook
Set Createdwb = Workbooks.Open(Filename:="blah.xls")
'or
Set Createdwb = Workbooks.Add
'other code, eg...
Createdwb.activate
'free memory
Set Createdwb = Nothing
End Sub
--------------------
hth
Rob
--
broro183
Rob Brockett. Always learning & the best way to learn is to
experience...
------------------------------------------------------------------------
broro183's Profile: 333
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=180996
Microsoft Office Help