Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This line works...
Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") this one returns a 1004 error... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") getting "smart" I tried... Set working = Workbooks.Open("""L:\theFolder\The Email.xls""") The file in question WILL have a space in the name when we receive it. Is there some trick to opening the file when there's a space in the name? Maury |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You must have misspelled the name (maybe it has two spaces).
This worked fine for me (demo'd from the immediate window) set wkbk = Workbooks.Open("C:\Data\Data1\Data2\A B C D E F.xls") ? wkbk.Name A B C D E F.xls -- Regards, Tom Ogilvy "Maury Markowitz" wrote in message ... This line works... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") this one returns a 1004 error... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") getting "smart" I tried... Set working = Workbooks.Open("""L:\theFolder\The Email.xls""") The file in question WILL have a space in the name when we receive it. Is there some trick to opening the file when there's a space in the name? Maury |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps it is not a space, just looks like one. If in Excel you use File +
Save AS, type MY followed by Alt + digits 2 5 5 on the numeric keypad followd by some file.xls, the resulting filename looks like MY file.xls but the character between the Y and the f is NOT a space. "Tom Ogilvy" wrote: You must have misspelled the name (maybe it has two spaces). This worked fine for me (demo'd from the immediate window) set wkbk = Workbooks.Open("C:\Data\Data1\Data2\A B C D E F.xls") ? wkbk.Name A B C D E F.xls -- Regards, Tom Ogilvy "Maury Markowitz" wrote in message ... This line works... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") this one returns a 1004 error... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") getting "smart" I tried... Set working = Workbooks.Open("""L:\theFolder\The Email.xls""") The file in question WILL have a space in the name when we receive it. Is there some trick to opening the file when there's a space in the name? Maury |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"AA2e72E" wrote:
Perhaps it is not a space, just looks like one. If in Excel you use File + Save AS, type MY followed by Alt + digits 2 5 5 on the numeric keypad followd by some file.xls, the resulting filename looks like MY file.xls but the character between the Y and the f is NOT a space. I think this is the problem. I wiped out the filename and retyped it with the space and it worked ok! Maury |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Maury,
One thing you can try: 1) Go to Tools | Options, General tab, and make sure "Ignore other applications" is unchecked. If that doesn't work, close Excel and try this: 2) Go to Start | Run in Windows, type "excel /regserver", and click OK. -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Maury Markowitz wrote: This line works... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") this one returns a 1004 error... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") getting "smart" I tried... Set working = Workbooks.Open("""L:\theFolder\The Email.xls""") The file in question WILL have a space in the name when we receive it. Is there some trick to opening the file when there's a space in the name? Maury |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So you mean the file received may or may not have space?
If this is the case then try:- On Error Resume Next Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") If Err < 0 Then Err.Clear Set working = Workbooks.Open("L:\theFolder\The Email.xls") End If On Error GoTo 0 Sharad "Maury Markowitz" wrote in message ... This line works... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") this one returns a 1004 error... Set working = Workbooks.Open("L:\theFolder\TheEmail.xls") getting "smart" I tried... Set working = Workbooks.Open("""L:\theFolder\The Email.xls""") The file in question WILL have a space in the name when we receive it. Is there some trick to opening the file when there's a space in the name? Maury |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) | |||
Parsing a space delimited file into segments | Excel Discussion (Misc queries) | |||
HOW DO I EDIT AN EXISTING FILE TO BE SPACE DELIMITED? | Excel Discussion (Misc queries) | |||
XL97: Out of stack space opening web page as workbook | Excel Programming | |||
VBA - import txt file using space separator | Excel Programming |