Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-22-2019, 08:15 PM
kiwimtnbkr kiwimtnbkr is offline Worksheet_Activate only if .xltm Windows 10 Worksheet_Activate only if .xltm Office 2010 64bit
Advanced Beginner
Worksheet_Activate only if .xltm
 
Join Date: Oct 2017
Posts: 69
kiwimtnbkr is on a distinguished road
Default Worksheet_Activate only if .xltm


The workbook template opens on worksheet1 which contains some instructions. When the user clicks on the worksheet2 tab to fill in the required information then the following original code caused a dropdown list to appear:

Code:
Private Sub Worksheet_Activate()
Range("H4").Select
Sendkeys "%{up}{NUMLOCK}", True
End Sub
When the workbook template saves it is saved as an .xlsm. I added the below code to stop the Sub from running when the now .xlsm file is opened

Code:
Private Sub Worksheet_Activate()
If ActiveWorkbook.FileFormat = xlOpenXMLWorkbookMarcoEnabled Then Exit Sub
Range("H4").Select
Sendkeys "%{up}{NUMLOCK}", True
End Sub
but this has now caused the dropdown list to no longer drop down in the .xltm file when the user clicks on the worksheet2 tab.

Where am I going wrong?

cheers
Mike

Last edited by kiwimtnbkr; 07-23-2019 at 01:41 PM. Reason: restructured question to reflect what is actual happening
Reply With Quote
 



Other Forums: Access Forums

All times are GMT -7. The time now is 06:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft