View Single Post
 
Old 04-30-2020, 06:46 PM
marceepoo marceepoo is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Sep 2012
Posts: 22
marceepoo is on a distinguished road
Default

I followed the very helpful suggestion you posted at 04-28-2020 06:33 PM:

Quote:
Originally Posted by Guessed View Post
We can't see which line is failing so we can't tell you where the issue is but the error is saying the object doesn't exist.

To find your lost item, put your report into a MsgBox instead of using a text file that you need to go and read using more macros.

Add a command button to your form and then press F7 to create the macro for it. Paste the following code into that macro
Code:
  Dim ctlLoop As control, sMsg As String
  sMsg = "Name, Top, Left" & vbCr
  For Each ctlLoop In Me.Controls
    sMsg = sMsg & ctlLoop.Name & ", " & ctlLoop.Top & ", " & ctlLoop.Left & vbCr
  Next ctlLoop
  MsgBox sMsg
Then display the form and click that button. It will display a list of the controls on the userform and their top and left position values. This should include your missing item and what its coordinates are.
I had to send the output (sMsg) to either the clipboard or a file because sMsg had 72 lines. I saved the clip to a csv file and then to the attached Excel file.

The coordinates of "txHyperlinkzName" are: .Top=162 and .Left=504

"txHyperlinkzName" is visible when I run the following:

Code:
Private Sub btnMoveTxtbox_Click()
    Me.txHyperlinkzName.Top = 134
    Me.txHyperlinkzName.Left = 24
    Me.txHyperlinkzName.BackColor = &HC000&
End Sub
But "txHyperlinkzName" disappears when I close the form, presumably returning to those weird coordinates: .Top=162 and .Left=504
I spent almost the entire day today trying unsuccessfully to figure out how to get the userform, “frmTOE_ExhMakeFromData01”, to save those coordinates into the form, so that "txHyperlinkzName" is situated at those coordinates when I am editing the form.

I await your next suggestion.
And I would like to thank you again.

Marc
Attached Files
File Type: xlsx userform_controls_locations.xlsx (11.7 KB, 7 views)
Reply With Quote