Thread
:
VBA does not open workbook
View Single Post
#
1
Posted to microsoft.public.excel.programming
Chip Pearson
external usenet poster
Posts: 7,247
VBA does not open workbook
Etienne
Most likely, the current path isn't correct. Try something like
Workbooks.Open Filename:="C:\full\path\workbook.xls"
' or
ChDrive "C:"
ChDir "C:\Full\Path"
Workbooks.Open Filename:="workbookname.xls"
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Etienne" wrote in
message ...
Here is the culprit code:
Workbooks.Open "workbookname.xls"
I tried
Workbooks.Open Filename:="workbookname.xls"
but it does not work
Thanks,
Etienne
-----Original Message-----
What do you mean when you say that VBA doesn't recognize
the name
of the file? Perhaps you could post the code that is
causing the
problem.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"etienne" wrote
in
message ...
Any insight as to why a VBA macro would not recognize
the
name of an existing Excel workbook? Somehow I can make
the
macro recognize the name by manually using 'save as'
with
the same name.
The macro does save the workbook when it has run
successfully by using the command 'ActiveWorkbook.Close
SaveChanges:=True'
Thanks
.
Reply With Quote
Chip Pearson
View Public Profile
Find all posts by Chip Pearson