ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening a document without adding the path (https://www.excelbanter.com/excel-programming/333863-opening-document-without-adding-path.html)

Tmf[_2_]

Opening a document without adding the path
 

Hey everyone.

I've got this code:

Workbooks.Open ("C:\Documents an
settings\tmf\Desktop\NY\TEST\template.xls")

ActiveWorkbook.SaveCopyAs "C:\Documents an
Settings\tmf\Desktop\NY\TEST\template1.xls"

I run this code from another file in the some folder "TEST". I woul
like to be able to run "template.xls" WITHOUT adding the path of th
folder "TEST". Of course the file with the code should be in the sam
folder.

I HTML one just say :\template.xls - how about VBA?

Please help me! :)

Best regards and thank you.

/Tomm

--
Tm
-----------------------------------------------------------------------
Tmf's Profile: http://www.excelforum.com/member.php...fo&userid=2498
View this thread: http://www.excelforum.com/showthread.php?threadid=38524


Jim Thomlinson[_4_]

Opening a document without adding the path
 
Use ThisWorkbook.Path for the path of the workbook with the code in it.
--
HTH...

Jim Thomlinson


"Tmf" wrote:


Hey everyone.

I've got this code:

Workbooks.Open ("C:\Documents and
settings\tmf\Desktop\NY\TEST\template.xls")

ActiveWorkbook.SaveCopyAs "C:\Documents and
Settings\tmf\Desktop\NY\TEST\template1.xls"

I run this code from another file in the some folder "TEST". I would
like to be able to run "template.xls" WITHOUT adding the path of the
folder "TEST". Of course the file with the code should be in the same
folder.

I HTML one just say :\template.xls - how about VBA?

Please help me! :)

Best regards and thank you.

/Tommy


--
Tmf
------------------------------------------------------------------------
Tmf's Profile: http://www.excelforum.com/member.php...o&userid=24985
View this thread: http://www.excelforum.com/showthread...hreadid=385247




All times are GMT +1. The time now is 10:24 AM.

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