ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Don't Show Msg Box if file ext is .xls (https://www.excelbanter.com/excel-programming/434008-dont-show-msg-box-if-file-ext-xls.html)

tpeter

Don't Show Msg Box if file ext is .xls
 
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

tpeter

Don't Show Msg Box if file ext is .xls
 
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



"tpeter" wrote:

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



All times are GMT +1. The time now is 08:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com