Open Workbook Assignment

N

Nigel

Hi All

If I create a new workbook, I can assign it to an object variable...

Dim wB as Workbook
Set wB = Workbooks.Add

How can I open an existing workbook and assign it?

Dim wB as Workbook
Set wB = Workbooks.Open "C:\myWork.xls"

Does not work!

TIA
 
B

Bob Phillips

Dim wB as Workbook
Set wB = Workbooks.Open("C:\myWork.xls")

should work


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top