Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default XL doesn't like my path?

I'm trying to tell XL which workbook to use:

Set wbOrig = H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in
Care original.xls

but it doesn't like my backslash. I searched in the NG, but couldn't
find a similar example. So how do I tell it the path and workbook name?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default XL doesn't like my path?

If wbOrig is a string, then you don't need Set:

wbOrig _
= "H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in Care original.xls"

And you need double quotes around the string.

If wbOrig is a workbook object:

Dim OrigName as string
dim OrigWkbk as workbook 'I like more info in the variables

OrigName _
= "H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in Care original.xls"

set OrigWkbk = workbooks.open(filename:=origname)


davegb wrote:

I'm trying to tell XL which workbook to use:

Set wbOrig = H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in
Care original.xls

but it doesn't like my backslash. I searched in the NG, but couldn't
find a similar example. So how do I tell it the path and workbook name?

Thanks!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default XL doesn't like my path?

set wbOrig = Workbooks.Open(filename:="H:\AllDocs\CFSR PIP DD\SFY 06
Q1\Records Base\Abuse in
Care original.xls")

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default XL doesn't like my path?

Or if it is already open
set wbOrig = Workbooks("H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records
Base\Abuse in Care original.xls")

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default XL doesn't like my path?

i'll just use something like this:

dim fPath as string
dim fName as string

fPath = "N:\My Documents\Excel\"
fName = fName = "Abuse in Care original.xls"

Workbooks.Open Filename:=fPath & fName

--


Gary

"davegb" wrote in message
oups.com...
I'm trying to tell XL which workbook to use:

Set wbOrig = H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in
Care original.xls

but it doesn't like my backslash. I searched in the NG, but couldn't
find a similar example. So how do I tell it the path and workbook name?

Thanks!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default XL doesn't like my path?

If it's already open, you can't have the path:

set wbOrig = Workbooks("Abuse in Care original.xls")



Kletcho wrote:

Or if it is already open
set wbOrig = Workbooks("H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records
Base\Abuse in Care original.xls")


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default XL doesn't like my path?


Dave Peterson wrote:
If wbOrig is a string, then you don't need Set:

wbOrig _
= "H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in Care original.xls"

And you need double quotes around the string.

If wbOrig is a workbook object:

Dim OrigName as string
dim OrigWkbk as workbook 'I like more info in the variables

OrigName _
= "H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in Care original.xls"

set OrigWkbk = workbooks.open(filename:=origname)


davegb wrote:

I'm trying to tell XL which workbook to use:

Set wbOrig = H:\AllDocs\CFSR PIP DD\SFY 06 Q1\Records Base\Abuse in
Care original.xls

but it doesn't like my backslash. I searched in the NG, but couldn't
find a similar example. So how do I tell it the path and workbook name?

Thanks!


--

Dave Peterson


Thanks everyone! I should have mentioned that wbOrig is a workbook
object. Got it worked out!

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
File Path Too Long? Not Anymore! Check out Long Path Tool Max Loger Excel Discussion (Misc queries) 1 March 24th 17 07:59 AM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Current path to Qualified Path Mary Excel Programming 1 October 14th 04 02:42 PM


All times are GMT +1. The time now is 09:03 PM.

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

About Us

"It's about Microsoft Excel"