ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Workbooks.Open Filename:=.UpdateLinks:=0, IgnoreReadOnlyRecommended:=True (https://www.excelbanter.com/excel-discussion-misc-queries/165263-workbooks-open-filename-%3D-updatelinks-%3D0-ignorereadonlyrecommended-%3Dtrue.html)

[email protected]

Workbooks.Open Filename:=.UpdateLinks:=0, IgnoreReadOnlyRecommended:=True
 
I can't seem to get this to work. I have read some of the other posts
for a similar bit of code but still can't get it to work. Can any one
help?

The error message says it is a

Run-time error '1004':
"could not be found. Check the spelling of the filename, and verify
that the file location is correct. etc, etc

The debug then highlights the bit of code I have put in my subject
heading.

What puzzels me about the message is that I am producing a list of
files from a source folder, so the spelling is as written on the file
names and not something I have typed into my list manually.


Dave O

Workbooks.Open Filename:=.UpdateLinks:=0, IgnoreReadOnlyRecommended:=True
 
Hi, Sue-
The line of code you posted in your subject line does not contain a
filename: I got that line to work when I used a filename, comme ca:
Workbooks.Open Filename:="c:\ok2del.xls", UpdateLinks:=0,
IgnoreReadOnlyRecommended:=True

Did you inadvertently leave that out of your code?

DaveO
Eschew obfuscation


Dave Peterson

Workbooks.Open Filename:=.UpdateLinks:=0,
 
You didn't specify a filename in the filename:= parm.



wrote:

I can't seem to get this to work. I have read some of the other posts
for a similar bit of code but still can't get it to work. Can any one
help?

The error message says it is a

Run-time error '1004':
"could not be found. Check the spelling of the filename, and verify
that the file location is correct. etc, etc

The debug then highlights the bit of code I have put in my subject
heading.

What puzzels me about the message is that I am producing a list of
files from a source folder, so the spelling is as written on the file
names and not something I have typed into my list manually.


--

Dave Peterson

Dave O

Workbooks.Open Filename:=.UpdateLinks:=0, IgnoreReadOnlyRecommended:=True
 
Hi, Sue-
The line of code you posted in your subject line does not contain a
filename: I got that line to work when I used a filename, comme ca:
Workbooks.Open Filename:="c:\ok2del.xls", UpdateLinks:=0,
IgnoreReadOnlyRecommended:=True

Did you inadvertently leave that out of your code?

DaveO
Eschew obfuscation


[email protected]

Workbooks.Open Filename:=.UpdateLinks:=0, IgnoreReadOnlyRecommended:=True
 
On 8 Nov, 16:49, Dave O wrote:
Hi, Sue-
The line of code you posted in your subject line does not contain a
filename: I got that line to work when I used a filename, comme ca:
Workbooks.Open Filename:="c:\ok2del.xls", UpdateLinks:=0,
IgnoreReadOnlyRecommended:=True

Did you inadvertently leave that out of your code?

DaveO
Eschew obfuscation


Yes I did miss it off. Tthe fielname is Filename but I haven't
defined it. Thanks for the clue. I'll try again.


[email protected]

Workbooks.Open Filename:=.UpdateLinks:=0, IgnoreReadOnlyRecommended:=True
 
On 9 Nov, 09:20, wrote:
On 8 Nov, 16:49, Dave O wrote:

Hi, Sue-
The line of code you posted in your subject line does not contain a
filename: I got that line to work when I used a filename, comme ca:
Workbooks.Open Filename:="c:\ok2del.xls", UpdateLinks:=0,
IgnoreReadOnlyRecommended:=True


Did you inadvertently leave that out of your code?


DaveO
Eschew obfuscation


Yes I did miss it off. Tthe fielname is Filename but I haven't
defined it. Thanks for the clue. I'll try again.


Hi everyone thanks for your tips
It all works fine now. This is my complete code

For X = 0 To RAfiles - 1
Y = Workbooks(Budsbk).Worksheets("RA Importer").Cells(16 + X, 5).Value
Workbooks.Open Y, UpdateLinks:=0, IgnoreReadOnlyRecommended:=True



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com