I have an excel with over 100 HTML textboxes that need their control values to be updated to match cell references. I am getting a runtime error 1004, Application or object defined error.
I have tried all combinations of the below to no avail.
- Test 1 from https://www.ozgrid.com/forum/index.php?thread/71462-copy-text-from-html-text-box/
Tests 2 and 3 from https://www.pcreview.co.uk/threads/addressing-htmltext-object-in-spreadsheet-vba-script.4014065/
Sub test() 'test1 Dim TB As OLEObject 'test2 'Dim TB As TextBox 'test3 'Dim TB As msforms.TextBox Set TB = ActiveSheet.TextBoxes(HTMLText99) 'Set TB = ActiveSheet.OLEObjects(HTMLText99) TB.Value = ActiveSheet.Cells(5, 7) 'TB.Text = ActiveSheet.Cells(5, 7) 'TB.Object.Value = ActiveSheet.Cells(5, 7) 'TB.Object.Text = ActiveSheet.Cells(5, 7) End Sub
Interestingly, if i just do a simple code (see below), the visible value of the HTML box changes as expected, but once I click "Detail view" in the developer tab, the visible value reverts back to the control value which I can see when I open properties on the HTML textbox.
ActiveSheet.HTMLText99.Value = ActiveSheet.Cells(5, 7)