+ Reply to Thread
Results 1 to 2 of 2

Checking filename on startup

  1. #1
    Registered User
    Join Date
    10-09-2006
    Posts
    13

    Checking filename on startup

    Hey guys,

    Tried a Google search on this, came up empty.

    I have put some code into an excel file I made, called "Top Label.xls." The problem is, some people already have an existing file called Top Label, and when they download mine, my file gets renamed to "Top Label (2).xls." Upon which, my VBA code doesn't work correctly.

    Is there any way to check on startup? That is, to make sure the file being opened is named "Top Label.xls," and if not, issue a warning to the user?

    Thanks in advance!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,572
    This might help get you started (in your ThisWorkBook module):
    PHP Code: 
    Private Sub workbook_open()
              If 
    ThisWorkbook.Name <> "Top Label.xls" Then
                 msgbox 
    "Warning!, etc."
              
    End If
    End Sub 
    Ben Van Johnson

+ Reply to Thread

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