Don't Show Msg Box if file ext is .xls

T

tpeter

I have a message box that opens when my spreadsheet is opened asking if it is
a new file. If they click yes, a user form comes up with selections. The file
is in Excel 2003 and is a template(the folder it is located in has special
privilages which allows you to open it without it being opened as a workbook,
so it is still a template and can be saved as a template without doing save
as template). I would like the message box and form to not appear and go
directly to sheet1 if the file has already been set up and saved as a .xls
file. Thank you for your assistance.

Tim Peter
 
T

tpeter

I figured it out:


Private Sub Workbook_Open()
If ActiveWorkbook.FileFormat = xlTemplate Then
Call QACompiled
Dim intresponse As Integer
intresponse = MsgBox("Is This a New Cold Box Order?", vbYesNo, "New File?")
If intresponse = vbYes Then
Customer.Show
Sheets("70 - 20 form").Select
Else
Sheets("70 - 20 form").Select
End If
End If
Sheets("70 - 20 form").Select
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top