Excel VBA Macro

  • Thread starter Thread starter Sheela
  • Start date Start date
S

Sheela

Hello,

I just wanna check if this excel VBA statement is correct:

Const DataPath = "U:\DATA\PROGRAM\"

Workbooks.Open Filename:=DataPath + "MOPS.XLS"

I need your advise. Thanks.

Sheela
 
Hi Sheela,

Yes, it is syntactically correct.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Workbooks.open DataPath & "Mops.xls"
Use & to join strings together
Hope this helps
Stuart
 
Hi Sheela,

I have tested your code in Excel 2000 and it runs fine for me. Exactly
what error are you getting? Is the error occurring on the workbooks.open
line? Are you sure that the specified path is valid on the machine where the
code is executing, that the specified workbook exists in that path, and that
the profile you are logged in with has full permissions to this location?

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Rob,

I will send you the file to your email add to give you a
better picture on the problem I'm facing.

Sheela
 
Back
Top