Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2022, 03:26 PM
EditorJack EditorJack is offline Extending a selection has stopped working in VBA Windows 10 Extending a selection has stopped working in VBA Office 2016
Novice
Extending a selection has stopped working in VBA
 
Join Date: May 2019
Posts: 2
EditorJack is on a distinguished road
Default

I develop Word add-ins for copyeditors and such. Many of my macros depend on being able to extend a text selection. However, the following commands no longer work at all, even if the add-in isn't loaded:

Selection.Extend


Application.Run MacroName:="ExtendSelection"
Selection.ExtendMode = True

This problem started after I assigned ExtendSelection to a custom keyboard shortcut in my add-in. At first it worked. Then it didn't. Now it actually crashes Word. Again, this is true even if no add-ins are loaded, and even after deleting the Normal.dotm template and starting again from scratch.

If I just press the F8 key, *then* ExtendSelection is turned on and works. But if I try to use the feature in a macro, using any of the above commands, I get nothing.

I've been writing macros for many years, so I know my way around VBA pretty well, but this is one of the weirdest things I've ever seen.

I know all about using Ranges vs. Selections, but sometimes I want the user to interact with the text, which means using Selection is sometimes necessary. When the macro has done its thing, I want to end the macro with Extend turned on for the user.

I really need to be able to use the feature using a macro. Any ideas about how to solve the problem? Thanks very much for any help.

Update: I see the same problem even if I start Word in Safe Mode.

I've been working mainly in Word 365, but I just tested in Word 10 and in Word 2003, with the same problem: Selection.Extend doesn't work. Maybe this is a Windows problem?
Reply With Quote
  #2  
Old 04-10-2022, 04:29 PM
macropod's Avatar
macropod macropod is offline Extending a selection has stopped working in VBA Windows 10 Extending a selection has stopped working in VBA Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Have you tried restarting your PC?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-11-2022, 07:27 AM
EditorJack EditorJack is offline Extending a selection has stopped working in VBA Windows 10 Extending a selection has stopped working in VBA Office 2016
Novice
Extending a selection has stopped working in VBA
 
Join Date: May 2019
Posts: 2
EditorJack is on a distinguished road
Default

Restarting Windows has no effect.
Reply With Quote
  #4  
Old 04-11-2022, 05:36 PM
Guessed's Avatar
Guessed Guessed is online now Extending a selection has stopped working in VBA Windows 10 Extending a selection has stopped working in VBA Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,161
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I would try rebuilding the Registry key for Word. Although if you are getting the same issue while running three versions of Word on the same machine then it might be hard to find the right section of the registry.

If you code your macro to extend a Range and then select that range does it work?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
extendselection, macros, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending a selection has stopped working in VBA extending a selection VBAFiddler Word VBA 4 03-07-2021 12:38 PM
Extending a selection has stopped working in VBA MS Word has stopped working aerophil Word 6 09-12-2018 07:51 PM
Extending a selection has stopped working in VBA Word stopped working judyn Word 5 10-18-2012 03:09 PM
Extending a selection has stopped working in VBA Tab key stopped working in Word jgriffin Word 2 06-24-2009 04:05 PM
Extending a selection has stopped working in VBA Excell stopped working TomC Excel 4 05-26-2006 11:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:37 PM.


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