View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Geetha[_2_] Geetha[_2_] is offline
external usenet poster
 
Posts: 1
Default 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