Greetings:
Judging by problem show below, I think I better book in for another year
of pre-school.
Code shown below: always skips from line 2 to line 4.
I have my codes in a file called Menu.xls. (will become an add-in, when
completed)
In case it was "reading" that file, I copied the code into a file called
EM_1234.xls
It still won't work.
A: What am I missing in my code?
B: Do I need something to indicate that FName is a short form for FileName?
In order for VB to understand it?
C: Will the code, when stored (in its entirety) as an add-in, "know" that
it has
to work on the currently active workbook?
Sub CheckFileName()
' If File Name Starts with 'EM_', Then Process CALL Not Allowed
' If File Name does NOT start with 'EM_', Then Exit Sub
1 Dim FName As String
2 If Left(FName, 3) = "EM_" Then
3 Call NotAllowed
4 Else: Exit Sub
5 End If
End Sub
Bookmarks