+ Reply to Thread
Results 1 to 5 of 5

Run Time error 1004 method sheets of object global failed

  1. #1
    Registered User
    Join Date
    04-01-2016
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    56

    Run Time error 1004 method sheets of object global failed

    I've just opened up a spreadsheet with some vba coding that I've been working on, on an old machine. The machine is running the same version of excel I programmed it in (2010).

    I opened the spreadsheet and enabled content, then I got this error message 'Run time error 1004 method sheets of object global failed' - I couldn't step through the code because it's password protected. So I hit 'end', and went back to the spreadsheet and it seemed to be working fine. I closed it and opened it again, and the same thing happened.

    I went into the vba, took off the password protection, thinking I'd save and re-open it, then at least when the error occurred I could look through the debugger. So I did, but this time the error didn't occur. I put the password protect back on, and it seems to be working fine now.

    I'm just slightly worried, because I'm a vba novice and this is a work project that others are using, and I don't know how serious this error is, or whether I should be worried! I've googled around but it didn't really help me. Does anyone know what this error is, and what might cause it? Is it the password protection of the code?

    Thank you.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run Time error 1004 method sheets of object global failed

    What does the code do?

    Also, why are you being asked to enable content?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-01-2016
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Run Time error 1004 method sheets of object global failed

    Quote Originally Posted by Norie View Post
    What does the code do?

    Also, why are you being asked to enable content?
    There's quite a lot of code, there are two user forms and various other bits.

    It asked me to enable content because I'd never opened the file on this machine before. I haven't had this error before with the file, and nor has anyone else to my knowledge.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run Time error 1004 method sheets of object global failed

    Sounds to me like there might be some sort of security issue, I've encountered the 'Enable content...' thing when opening files downloaded from the internet or not from 'Trusted Sources.

    Where is the file stored?

    Is the problem specific to this one machine?

  5. #5
    Registered User
    Join Date
    04-01-2016
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Run Time error 1004 method sheets of object global failed

    Quote Originally Posted by Norie View Post
    Sounds to me like there might be some sort of security issue, I've encountered the 'Enable content...' thing when opening files downloaded from the internet or not from 'Trusted Sources.

    Where is the file stored?

    Is the problem specific to this one machine?
    I downloaded it from my email - I'm self-employed and borrowed an old pc just so I had something to work with. I saved it onto the desktop.

    It's only happened with this machine as far as I know - it never happened when I opened it on my old machine, and a couple of other people have used the file, and if they've had the error they haven't mentioned it to me (and they would, because I programmed it for them).

+ 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. [SOLVED] Error 1004 Method 'Add'of Object Sheets failed
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-21-2019, 07:46 AM
  2. Run-time error '1004': Method 'Sheets' of object '_Global' failed
    By dancko in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2014, 04:42 PM
  3. Subtotal Macro Run Time error 1004 range of object global failed
    By tppuzzled in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-16-2014, 04:32 PM
  4. Run-time error '1004': Method 'Sheets' of object '_Global' failed
    By stigb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2013, 03:35 PM
  5. Run-time error '1004': Method 'Range' of object 'Global' failed
    By djwestholm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2012, 04:52 PM
  6. Run-time error '1004': Method 'Range' of object '_ Global' failed
    By mdvc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 11:48 AM
  7. runtime error 1004 method range of object global failed
    By dreamz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2006, 03:25 PM

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