Opening a Workbook

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I'm trying to write a subroutine that opens a saved
workbook that resides in the same directory of my active
workbook, so that I can pull data from worksheets in that
workbook. My subroutine looks like this:

Sub Try()
Workbooks.Open "saved workbook"
End Sub

When I run this, however, i get an error saying that the
workbook cannot be found. I tried using the full path and
anf file extensions as well, but no luck. Has anyone run
into this problem as well?
 
Matt,

Try

ChDir Activeworkbook.Path

beforehand

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Bob,

That did it.

Thanks!

Matt
-----Original Message-----
Matt,

Try

ChDir Activeworkbook.Path

beforehand

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




.
 
Back
Top