+ Reply to Thread
Results 1 to 2 of 2

Path/File Access Error

  1. #1
    Geetha
    Guest

    Path/File Access Error

    Hi,

    I get an Error message saying "Path/File Access Error" when i try
    to create a new worksheet in a macro. The same macro works fine on my
    machine, and we tested in 3-4 other machines. It fails only on a
    particular machine. following is the code sample that causes the
    problem.

    Dim Sheet As Worksheet
    Set Sheet = Sheets.Add(Type:=ThisWorkbook.Path & "\Report.xlt")

    where Report.xlt is a template file that is stored in the same location
    as the Excel file itself. Can anyone please help me figure out what
    might be wrong. The code fails even when I create the worksheet without
    using a template("Report.xlt). That is by using the following code

    Dim Sheet As Worksheet
    Set Sheet = Sheets.Add

    Thanks.
    Geetha


  2. #2
    NickHK
    Guest

    Re: Path/File Access Error

    Geetha,
    I can't duplicate your error with a variety of bad paths etc.
    What does ThisWorkbook.Path evaluate to ?
    Something strange about the permissions on that folder ?

    NickHK

    "Geetha" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I get an Error message saying "Path/File Access Error" when i try
    > to create a new worksheet in a macro. The same macro works fine on my
    > machine, and we tested in 3-4 other machines. It fails only on a
    > particular machine. following is the code sample that causes the
    > problem.
    >
    > Dim Sheet As Worksheet
    > Set Sheet = Sheets.Add(Type:=ThisWorkbook.Path & "\Report.xlt")
    >
    > where Report.xlt is a template file that is stored in the same location
    > as the Excel file itself. Can anyone please help me figure out what
    > might be wrong. The code fails even when I create the worksheet without
    > using a template("Report.xlt). That is by using the following code
    >
    > Dim Sheet As Worksheet
    > Set Sheet = Sheets.Add
    >
    > Thanks.
    > Geetha
    >




+ 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