R RPIJG May 17, 2004 #1 Can I make it so that the command button is only visible when I open workbook from an .xlt and not from a .xls
Can I make it so that the command button is only visible when I open workbook from an .xlt and not from a .xls
J Jan Karel Pieterse May 17, 2004 #2 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? Click to expand... 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
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? Click to expand... 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