Show form based on file type

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

G'day,
I have a template that I want to be able to open a different userform
depending on the type of document, e.g. when I open the template I want
userform1 to open, when I create a new spreadsheet based on the template, I
want userform2 to open.

Is there anyway that I can do this?

I have tried using an auto open macro (MS Office 2000), to detect the
filename (ie filename.xlt or newfile1.xls) but this doesn't work.

Any suggestions?

Thanks,
 
If you are editing the template, the extension should be

xlt

If lcase(Right(thisworkbook.name,3)) = "xlt" then
' template
else
' workbook

End if
 
Back
Top