excel 2002 runtime error 1004

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
 
J

JE McGimpsey

Sounds like XL can't find your template file. Are you sure the path and
filename are correct?
 
X

xenod

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
 
N

NickHK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top