+ Reply to Thread
Results 1 to 2 of 2

Opening a document without adding the path

  1. #1
    Registered User
    Join Date
    07-07-2005
    Posts
    3

    Opening a document without adding the path

    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

  2. #2
    Jim Thomlinson
    Guest

    RE: 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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1