+ Reply to Thread
Results 1 to 6 of 6

Run-time error 1004

  1. #1
    arcillamd@gmail.com
    Guest

    Run-time error 1004

    Posted this somewhere else, but trying to get this solved today, so
    hoping I'll get some guidance here:

    -----------------
    I tried doing a search for this error message, but couldn't find one
    related to my problem, so here goes.

    Running Excel 2000 here and this macro (snippet below) has been running
    fine on several machines. Suddenly, this one machine in particular has
    been getting a 1004 Run-time error (in the With statement).

    I have an idea what the problem is, but the thing that gets me is this
    code still successfully works on several other machines at my work
    place.

    I know the code is sloppy, as you'll see below. I'm simply trying to
    fix something that was already in place before I got here. I'll
    definitely clean it up once I get it working.

    Any ideas? Thanks in advance for the help.

    --------------------------------------------

    Sub maketable()


    Application.DisplayAlerts = False
    Application.ScreenUpdating = False

    DirPathVars '< Defines variables

    Workbooks.Add
    With Application
    .DefaultFilePath = DPTH1 & DPTH11 '<<
    .SheetsInNewWorkbook = 1
    Cells.Select
    .StandardFont = "Century Schoolbook"
    .StandardFontSize = 8
    Selection.ColumnWidth = 2
    Selection.RowHeight = 13 '13

    End With

    .....

    --------------------------------------------


    Error description:
    Run-time error '1004':

    Method 'DefaultFilePath' of object '_Application' failed


  2. #2
    CarloC
    Guest

    RE: Run-time error 1004

    Off the top of my head, the only thing that I can see is that the Font
    "Century Schoolbook" or the default file path exists on the other machines
    but not this one. But somehow that is too obvious to be true.
    --
    3c


    "arcillamd@gmail.com" wrote:

    > Posted this somewhere else, but trying to get this solved today, so
    > hoping I'll get some guidance here:
    >
    > -----------------
    > I tried doing a search for this error message, but couldn't find one
    > related to my problem, so here goes.
    >
    > Running Excel 2000 here and this macro (snippet below) has been running
    > fine on several machines. Suddenly, this one machine in particular has
    > been getting a 1004 Run-time error (in the With statement).
    >
    > I have an idea what the problem is, but the thing that gets me is this
    > code still successfully works on several other machines at my work
    > place.
    >
    > I know the code is sloppy, as you'll see below. I'm simply trying to
    > fix something that was already in place before I got here. I'll
    > definitely clean it up once I get it working.
    >
    > Any ideas? Thanks in advance for the help.
    >
    > --------------------------------------------
    >
    > Sub maketable()
    >
    >
    > Application.DisplayAlerts = False
    > Application.ScreenUpdating = False
    >
    > DirPathVars '< Defines variables
    >
    > Workbooks.Add
    > With Application
    > .DefaultFilePath = DPTH1 & DPTH11 '<<
    > .SheetsInNewWorkbook = 1
    > Cells.Select
    > .StandardFont = "Century Schoolbook"
    > .StandardFontSize = 8
    > Selection.ColumnWidth = 2
    > Selection.RowHeight = 13 '13
    >
    > End With
    >
    > .....
    >
    > --------------------------------------------
    >
    >
    > Error description:
    > Run-time error '1004':
    >
    > Method 'DefaultFilePath' of object '_Application' failed
    >
    >


  3. #3
    deltree
    Guest

    Re: Run-time error 1004

    The macro worked fine as of last Friday, then all the sudden come
    Monday morning, the error came up. This file is synchronized every
    morning and I was able to run the process just fine on several other
    machines to this date.

    I'm thinking something was messed up with the Excel references,
    configuration, add-ins, or something along that line, but I just can't
    put my finger on it. It looks the same as far as I could tell.

    The directory referenced exists on all machines in question and the
    font does as well.


  4. #4
    deltree
    Guest

    Re: Run-time error 1004

    Additional note on the problem machine:

    Nothing shows up when clicking on Options in the Tools menu.


  5. #5
    NickHK
    Guest

    Re: Run-time error 1004

    Check the registry under:

    HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Options

    changing the 9.0 to your version of Excel. Some settings may also be at:
    HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\General

    On the problem machine, what do you get in the immediate window with:
    ?Application.DefaultFilePath

    and can you set it with:
    Application.DefaultFilePath = <Path>

    NickHK

    "deltree" <arcillamd@gmail.com> wrote in message
    news:1155770011.570612.12100@h48g2000cwc.googlegroups.com...
    > Additional note on the problem machine:
    >
    > Nothing shows up when clicking on Options in the Tools menu.
    >




  6. #6
    deltree
    Guest

    Re: Run-time error 1004

    The problem wasn't the DefaultPath, but thanks for pointing me to look
    at the registry. I noticed a few settings didn't match. Once I
    matched them to the working machines, everything ran fine, just like it
    used to.

    Thanks


+ 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