Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
File Path Too Long? Not Anymore! Check out Long Path Tool | Excel Discussion (Misc queries) | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
hyperlink navigation path path wrong in Excel 2003 | Excel Discussion (Misc queries) | |||
how to change absolute path to relative path | Excel Worksheet Functions | |||
Current path to Qualified Path | Excel Programming |