excel 2002 runtime error 1004

  • Thread starter Thread starter xenod
  • Start date Start date
X

xenod

Hi, I have a problem with this code, when open a file excel show an
error runtime 1004 on add method, Why ?

Thanks for help


private sub aprifile()
Set EExcel = CreateObject("Excel.Application")
Set EWorkbook = EExcel.Workbooks

'Apre File Excel Template
Call EWorkbook.Add("p:\pubblica\procedure\modulistica\rilevazione
personale.xlt")

EExcel.Visible = True
end sub
 
Sounds like XL can't find your template file. Are you sure the path and
filename are correct?
 
Sounds like XL can't find your template file. Are you sure the path and
filename are correct?
yes, i'm sure, the file exist, before open file I check the file.
The error is:
Run-time error 1004
'add' method for object workbooks not success
 
xenod
How about:

private sub aprifile()
Set EExcel = CreateObject("Excel.Application")

'Apre File Excel Template
Set EWorkbook
=EExcel.Workbooks.Add("p:\pubblica\procedure\modulistica\rilevazione
personale.xlt")

EExcel.Visible = True
end sub

NickHK
 
Back
Top