Show form based on file type

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,
 
T

Tom Ogilvy

If you are editing the template, the extension should be

xlt

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

End if
 

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