View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
etienne etienne is offline
external usenet poster
 
Posts: 1
Default VBA does not open workbook

thanks, Etienne
-----Original Message-----
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





.



.