+ Reply to Thread
Results 1 to 4 of 4

excel 2002 runtime error 1004

  1. #1
    xenod
    Guest

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

    EExcel.Visible = True
    end sub

  2. #2
    JE McGimpsey
    Guest

    Re: 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 <MPG.1cbc59e538918b1f989701@news.it.net>, xenod <xxx@xxx.xx>
    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\rilevazione
    > personale.xlt")
    >
    > EExcel.Visible = True
    > end sub


  3. #3
    xenod
    Guest

    Re: excel 2002 runtime error 1004

    In article <jemcgimpsey-F50C84.07485905042005@msnews.microsoft.com>,
    jemcgimpsey@mvps.org says...
    > Sounds like XL can't find your template file. Are you sure the path and
    > filename are correct?
    >
    > In article <MPG.1cbc59e538918b1f989701@news.it.net>, xenod <xxx@xxx.xx>
    > 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\rilevazione
    > > 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


  4. #4
    NickHK
    Guest

    Re: 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\modulistica\rilevazione
    personale.xlt")

    EExcel.Visible = True
    end sub

    NickHK



    "xenod" <xxx@xxx.xx> wrote in message
    news:MPG.1cbc59e538918b1f989701@news.it.net...
    > 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




+ 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