Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-13-2012, 12:18 PM
Andrew H Andrew H is offline Drop-Downs:  Run Macro on Exit Windows 7 32bit Drop-Downs:  Run Macro on Exit Office 2010 32bit
Advanced Beginner
Drop-Downs:  Run Macro on Exit
 
Join Date: Nov 2012
Location: Montreal, Quebec
Posts: 51
Andrew H is on a distinguished road
Default Drop-Downs: Run Macro on Exit

It appears that a macro that I have set up to run "on exit" from a drop-down list is not executing. At present, I am simply interested in learning how to get any macro to run on exit. Here is the macro that I have set up to run on exit:

Sub PrintTextonSelection()
ActiveDocument.Unprotect
Dim MyText As String


MyText = "I made a selection"
Selection.TypeText (MyText)
End Sub

To test, I first protected the file (in order to allow use of the drop-down) and then made a selection. Result: the "I made a selection" text was not inserted nor did the document transition to an unprotected state.

I am a complete novice re VBA and macros. Any suggestions welcomed.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop-Downs:  Run Macro on Exit Fire drop down Macro on change carlosriver24 Word 1 08-02-2012 07:18 PM
Drop-Downs:  Run Macro on Exit Macro ? - Checkbox in Word + drop down selection help dice1976 Word 4 07-24-2012 11:18 AM
Drop-Downs:  Run Macro on Exit Drag and drop macro Amanoo PowerPoint 2 06-15-2012 04:01 AM
Drop and drag macro Jamtart PowerPoint 3 04-15-2012 11:05 PM
Drop-Downs:  Run Macro on Exit Please help me with drop downs in Excel 2010 mhays Excel 6 01-16-2012 09:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:46 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