Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Opening a Workbook

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Opening a Workbook

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)

"Matt" wrote in message
...
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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Opening a Workbook

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)

"Matt" wrote in

message
...
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?



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop blank workbook from opening when opening an existing kjg Excel Discussion (Misc queries) 3 February 12th 10 09:36 PM
How to make the opening of a workbook conditional upon the opening of another workbook Marcello do Guzman Excel Programming 1 December 16th 03 06:09 AM
How to make opening of workbook conditional of opening of another workbook turk5555[_2_] Excel Programming 2 December 15th 03 11:07 PM
Preventing opening workbook inside active workbook. Serge[_4_] Excel Programming 2 November 4th 03 07:51 PM
Question for Experts: Opening workbook with workbook references Chris Excel Programming 0 September 11th 03 07:05 PM


All times are GMT +1. The time now is 06:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"