View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] brian.misner@gmail.com is offline
external usenet poster
 
Posts: 1
Default Need "Filename Equals" code help.

Basically, I am running two message boxes that lead into the save as
menu every time the file S:\Mileage Reimbursement Form.xls is opened.

Once the user has saved the file on their own personal network drive
space, the message boxes and save as dialog still appear. I do not
want this to occur. I keep getting either "End if without Block If"
and error 424. How do I code for this? Thanks for any help you can
provide.

Private Sub Workbook_Open()
If Filename.equals("Mileage_Reimbursement_Form.xls") Then
MsgBox "Welcome to the mileage form. Please do not modify
this form in any way or it may not calculate your mileage correctly.
If you need additional rows, please click the 'New Row' button."
MsgBox "Before you start filling out this form, please
save a copy on your F: drive. You should name the file according to
the following format: (Your Name) MM/YYYY Mileage"
For Each wb In Workbooks
wb.Activate
Application.Dialogs(xlDialogSaveAs).Show

End If
Next

End Sub