Make Command Button visible only in .xlt?

  • Thread starter Thread starter RPIJG
  • Start date Start date
R

RPIJG

Can I make it so that the command button is only visible when I open
workbook from an .xlt and not from a .xls
 
Hi Rpijg,
Can I make it so that the command button is only visible when I open a
workbook from an .xlt and not from a .xls?

A workbook opened from a template has an empty path property, you could
test for that:

If ActiveWorkbook.Path="" and left(Activeworkbook.name,4)><"Book" then
'Code to disable your button
Else
'Code to Enable the button
End If

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 

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

Back
Top