Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-28-2020, 02:10 PM
marceepoo marceepoo is offline Userform textbox control missing/invisible; can't find, use or replace it; how to salvage work on a Windows 7 64bit Userform textbox control missing/invisible; can't find, use or replace it; how to salvage work on a Office 2010 64bit
Novice
Userform textbox control missing/invisible; can't find, use or replace it; how to salvage work on a
 
Join Date: Sep 2012
Posts: 22
marceepoo is on a distinguished road
Default Userform textbox control missing/invisible; can't find, use or replace it; how to salvage work on a

I made a userform named, “frmTOE_ExhMakeFromData01” which contains a textbox control named, “txHyperlinkzName”

The textbox control disappeared. I assumed that I must have inadvertently deleted it during the weeks I’ve been working on the userform, and I tried to recreate the textbox, “txHyperlinkzName”

But when I tried to assign the named “txHyperlinkzName” to the new textbox control, a message from Windows VBA said:
Could not set the Name property. Ambiguous name.

Hoping to make the textbox control prominent in the userform so that I could find it among the many controls on the userform, I ran a sub which assigned a vibrant color to the control’s background property, and I assigned text to the textbox’s text property. To no avail; the textbox still was not visible.

I ran the following sub to get a list of all of the controls in the userform:

Code:
Sub subUserformControls_Output2TxFile(sFormName As UserForm)
    'https://stackoverflow.com/questions/25248034/how-do-i-list-print-control-names-and-or-properties-on-a-vba-form
    Dim ctlLoop As MSForms.Control
    Dim sMsgboxMsg As String
    Dim sDateTime As String
    sDateTime = CStr(Format(Now(), "yyyy-mm-dd_hh-mm-ss"))
    sMsgboxMsg = sDateTime
    
    For Each ctlLoop In sFormName.Controls
        sMsgboxMsg = sMsgboxMsg & vbCrLf & _
           CStr(TypeName(ctlLoop)) & ":" & CStr(ctlLoop.Name)
    Next ctlLoop
    
    Call subWrite2TxtFileAndOpenInEditPadPro(sMsgboxMsg)
    
End Sub ' subUserformControls_Output2TxFile(sFormName)
I think that the foregoing is the sub I used (and of which I was very proud); but the sub now only produces the error message:
Run-time error '91':
Object variable or With block variable not set

That sub or some other version (of that sub) which I inadvertently deleted, produced an output listing all of the controls in the form, and the list did indeed include a textbox control named, “txHyperlinkzName”



Questions:
A. What did I do to cripple the sub above?
B. What do I do now?
1. Should I just create a new textbox control and put it where the missing one was, and continue working on the form? or ...
2. Should I presume that the file is corrupt and that continuing to work on its development is a waste of time? In other words, should I start over on my userform from scratch? or ...
3. I created my userform in the VBA IDE, dragging textboxes, labels, cmd buttons, etc. onto a canvas. But I think people with more knowledge than I have, create userforms entirely by VBA. In other words, are there VBA techniques I could use to:
a. Extract from my userform all the properties of each control (frames, textboxes, labels, cmd btns, option btns, etc.) including the location information (i.e., where they were situated in the userform, and the size (length and width) of the control)?
b. Use the extracted info to re-create the userform?

Thank you for any advice.

Marc
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform textbox control missing/invisible; can't find, use or replace it; how to salvage work on a Find and replace query re missing spaces Johanna Word 3 11-22-2019 01:06 AM
Userform textbox control missing/invisible; can't find, use or replace it; how to salvage work on a Macro to Find and Replace Does Not Work - But Works Manually Rod_Bowyer Excel Programming 7 10-14-2018 11:49 PM
Userform textbox control missing/invisible; can't find, use or replace it; how to salvage work on a Find and Replace doesn't work. Bop70 Word 3 02-04-2015 11:45 AM
Userform is invisible in Project box for old templates billy8b8 Word VBA 4 07-19-2014 03:44 PM
Find and replace No longer work TJH Word 3 03-25-2014 11:33 PM

Other Forums: Access Forums

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