Excel VBA Macro

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
 
R

Rob Bovey

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 *
 
S

Stuart

Workbooks.open DataPath & "Mops.xls"
Use & to join strings together
Hope this helps
Stuart
 
R

Rob Bovey

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 *
 
S

Sheela

Rob,

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

Sheela
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top