ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel 2002 runtime error 1004 (https://www.excelbanter.com/excel-programming/326811-excel-2002-runtime-error-1004-a.html)

xenod

excel 2002 runtime error 1004
 
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\r ilevazione
personale.xlt")

EExcel.Visible = True
end sub

JE McGimpsey

excel 2002 runtime error 1004
 
Sounds like XL can't find your template file. Are you sure the path and
filename are correct?

In article , xenod
wrote:

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\r ilevazione
personale.xlt")

EExcel.Visible = True
end sub


xenod

excel 2002 runtime error 1004
 
In article ,
says...
Sounds like XL can't find your template file. Are you sure the path and
filename are correct?

In article , xenod
wrote:

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\r ilevazione
personale.xlt")

EExcel.Visible = True
end sub


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


NickHK

excel 2002 runtime error 1004
 
xenod
How about:

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

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

EExcel.Visible = True
end sub

NickHK



"xenod" wrote in message
...
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\r ilevazione
personale.xlt")

EExcel.Visible = True
end sub





All times are GMT +1. The time now is 01:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com