Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 07-19-2023, 04:18 PM
Guessed's Avatar
Guessed Guessed is offline Word VBA code unable to find Bookmark Windows 10 Word VBA code unable to find Bookmark Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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 agree with Greg that bookmarks are a poor option for the placing of information but that is not where your particular problem is coming from.

From your listed items in post 6 above, it sounds like you are running this code in step 3 (outside the userform itself). This gives me the indication of where your problem is coming from.

If the userform is closed then the values you put in the userform are no longer available to other macros (which leads to an object doesn't exist error). While the txtName is available in the context of the Userform, it is not available to macros outside of the userform code if that userform is closed. If the userform was opened and then hidden (not closed) the value would be available but you would need to include a pointer to the userform's name (userformname.txtName.Text).
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
REf Fields show Bookmark whole cell when Bookmark is created by code. pmcpowell Word VBA 2 11-16-2019 07:05 PM
How do I code bookmark globally for different template? Yong Xiang Word VBA 17 02-06-2019 01:09 PM
Word VBA code unable to find Bookmark Field Code: Show a value only if bookmark is not empty Cosmo Word 7 08-24-2018 01:46 PM
Word VBA code unable to find Bookmark Find word, Insert Paragraph and bookmark gattaca714 Word VBA 2 03-24-2017 09:23 PM
Find Bookmark, move to bookmark, execute code, repeat raymm3852 Word VBA 10 04-15-2016 06:21 PM

Other Forums: Access Forums

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