Results 1 to 7 of 7

Run-time error '1004': Method 'Worksheets' of object '_Global' failed

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Run-time error '1004': Method 'Worksheets' of object '_Global' failed

    Run-time error '1004': Method 'Worksheets' of object '_Global' failed

    I get this error when running the following code:

    Sub NewSheet()
    
         '
         ''
    ''''''''
    ' Create/rename new sheet.
    ''''''''
         ''
         '
         
    Dim NWS As Worksheet
    Set NWS = Sheets.Add(After:=Worksheets(Worksheets.Count))
    NWS.Name = "WAWA " & Format(Date, "mm-dd-yyyy")
    
    End Sub
    I just want to add a sheet at the end of the workbook. This code used to work just fine with Windows XP and Office 2007. We recently updated to Windows 7 and Office 2010 and now the code breaks at the Set NWS line. Am I missing a reference somewhere? Thanks for any suggestions!
    Last edited by JSebastianRock; 02-20-2013 at 10:37 AM. Reason: SOLVED

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