+ Reply to Thread
Results 1 to 10 of 10

Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    I'm having issues with this macro to delete names in the workbook.
    It used to work with Excel 2007 but not with the 365 version.

    Please Login or Register  to view this content.
    Capture.PNG
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-09-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    148

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    Hi There,

    I am running Office 365 and your macro does exactly what it should for me, and without errors.

  3. #3
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    OK that's interesting.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,912

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    What build are you running? The last Insider build had numerous weird VBA bugs in it.
    Rory

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    I get exactly the same thing with the names xl creates like _xlfn.COUNTIFS
    So I usually just unhide the names & delete them manually.


    EDIT:
    Forgot to add I'm just on the normal "Current Channel"
    Last edited by Fluff13; 05-23-2021 at 05:17 PM.

  6. #6
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    What build are you running?
    This is the version:
    Microsoft Excel for Microsoft 365 MSO (16.0.13127.21222) 32-bit

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,912

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    Your file works for me in 2016 32 bit and 365 64 bit (build 16.0.14117.20000)

  8. #8
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    OK thanks for confirming.
    I'll just have to sort it out some other way.

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,912

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    Have you determined which name is causing the error?

  10. #10
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    Have you determined which name is causing the error?
    It would be any name. The sample workbook has arbitrary names which replaced what I originally had (just letters with underscore characters).
    It worked fine in a previous version.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 08-08-2016, 04:35 PM
  2. [SOLVED] Run-time error '1004': Delete method of Range class failed
    By Nobo1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2016, 03:01 AM
  3. Combobox selection / Delete row after saving in another sheet / Run-time error '1004'
    By Arvin.Amaro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2015, 07:27 PM
  4. Run-time error '1004': Delete method of Range class failed
    By Lozza1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2014, 04:56 PM
  5. [SOLVED] Run-time error '1004' ; Delete method of Range Class failed
    By Adam1987 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2012, 06:43 AM
  6. Defined Names + Macro = Error 1004
    By ThatGuyNamedRyan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2011, 04:40 PM
  7. Run time error 1004 syntax problem
    By 1eyedjack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2010, 04:51 AM

Tags for this Thread

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