Consulting

Results 1 to 3 of 3

Thread: Solved: Quit Application if filename is renamed

  1. #1
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location

    Solved: Quit Application if filename is renamed

    How can I code this.

    [vba]
    Private Sub Workbook_Activate()
    If "workbook.filename <> book1.xls" then
    application.quit

    Else
    'Open the Workbook"

    End if

    [/vba]
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

  2. #2
    VBAX Tutor nst1107's Avatar
    Joined
    Nov 2008
    Location
    Monticello
    Posts
    245
    Location
    [VBA]Private Sub Workbook_Activate()
    If ThisWorkbook.Name <> "Book1.xls" Then Application.Quit
    End Sub
    [/VBA]

  3. #3
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •