ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA Macro (https://www.excelbanter.com/excel-programming/274610-excel-vba-macro.html)

sheela

Excel VBA Macro
 
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

Rob Bovey

Excel VBA Macro
 
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 *


"Sheela" wrote in message
...
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




Stuart[_7_]

Excel VBA Macro
 
Workbooks.open DataPath & "Mops.xls"
Use & to join strings together
Hope this helps
Stuart
-----Original Message-----
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
.


Rob Bovey

Excel VBA Macro
 
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 *


"sheela" wrote in message
...
Well, I tried that but it is still giving the error.
Actually, this macro was created in Excel 95. I want to
run in Excel 2000 and it gives me an error.

Sheela

-----Original Message-----
Workbooks.open DataPath & "Mops.xls"
Use & to join strings together
Hope this helps
Stuart
-----Original Message-----
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
.

.




sheela

Excel VBA Macro
 
Rob,

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

Sheela

-----Original Message-----
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 *


"sheela" wrote in message
...
Well, I tried that but it is still giving the error.
Actually, this macro was created in Excel 95. I want to
run in Excel 2000 and it gives me an error.

Sheela

-----Original Message-----
Workbooks.open DataPath & "Mops.xls"
Use & to join strings together
Hope this helps
Stuart
-----Original Message-----
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
.

.



.



All times are GMT +1. The time now is 04:36 PM.

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