ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable a userform after first use? (https://www.excelbanter.com/excel-programming/427031-re-disable-userform-after-first-use.html)

Dave Peterson

Disable a userform after first use?
 
I'm not quite sure what you're doing, but if you saved your workbook as a
template (*.xlt in xl2003 and earlier), then the users would use it to create a
new workbook--not to open, edit and save as a new name.

Then you can check the path of that file:

Option Explicit
Private Sub Workbook_Open()
if me.path = "" then
'never been saved, so it's just been created
notsofast.show
end if
end sub


Double clicking on a .xlt file in windows explorer should create a new workbook.

Bishop wrote:

I have a MASTER spreadsheet that 10 people on the team open. I created a
userform and set it to open when the spreadsheet opens.

Private Sub Workbook_Open()
NotSoFast.Show
End Sub

I was under the impression that the NAME of the spreadsheet is what
triggered the userform. However, even after I change the name of the
spreadsheet it still opens my userform. What I need is for the userform to
come up ONLY when the MASTER spreadsheet is opened. Once the members of the
team "save as..." I don't want it to pop everytime they open their copy. How
can I make this happen?


--

Dave Peterson


All times are GMT +1. The time now is 12:20 AM.

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