Results 1 to 2 of 2

Excel 2007 workbook_open events are not working

Threaded View

  1. #1
    Registered User
    Join Date
    12-02-2008
    Location
    USA
    Posts
    38

    Excel 2007 workbook_open events are not working

    Hi,
    I have my lab computer upgraded from Excel 2003 to Excel 2007. Follwing code is not working on this computer.
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    ThisWorkbook.Worksheets("summary").Range("d5") = Environ$("username")
    ThisWorkbook.Worksheets("summary").Range("d6") = Now()
    End Sub
    
    Private Sub Workbook_open()
    ThisWorkbook.Worksheets("summary").Range("d7") = Environ$("username")
    ThisWorkbook.Worksheets("summary").Range("d8") = Now()
    End Sub
    The error is "Run Time Error 57121 Application defined or Object defined error'
    My new Laptop has Excel 2007 insatlled by default( I mean not upgraded from Excel 2003) and the above code works well. Any idea what is happening?
    Last edited by ljoseph; 05-12-2010 at 09:32 AM. Reason: Wrong heading

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