geonjay
03-16-2017, 09:46 AM
Hello. I hope this doesn't turn out to be a stupid question.
I've created some simple string manipulation code in VB. I developed it on Excel in Windows 7. When I go to run the code on Mac Excel 2016 (15.32) - the button won't click. When I open up the VB editor in Mac and click Run I get the classic "Run-time error '424': Object required". I click ok, and step through the code - all of the string manipulations work (I'm just adding new lines of text to a variable) but when I go to set the textbox text value I get the error.
Code is simply
TextBox1.Text = AppConf
Again, the code works in windows. If I do a simple "MsgBox AppConf" I get a msg box pop-up that contains the text I'm looking for. When I click on "Selection Pane" I can see my two buttons "CommandButton1" and "CommandButton2" and I see the textbox that I created "TextBox 1". I've tried renaming it to TextBox1 (removed the space). I know it's something silly. Can anyone help?
Private Sub CommandButton1_Click()
Dim AppConf As String
AppConf = "Test text" & vbCrLf
AppConf = AppConf & "More Text" & vbCrLf
TextBox1.Text = AppConf
and then it gives me the error
I've created some simple string manipulation code in VB. I developed it on Excel in Windows 7. When I go to run the code on Mac Excel 2016 (15.32) - the button won't click. When I open up the VB editor in Mac and click Run I get the classic "Run-time error '424': Object required". I click ok, and step through the code - all of the string manipulations work (I'm just adding new lines of text to a variable) but when I go to set the textbox text value I get the error.
Code is simply
TextBox1.Text = AppConf
Again, the code works in windows. If I do a simple "MsgBox AppConf" I get a msg box pop-up that contains the text I'm looking for. When I click on "Selection Pane" I can see my two buttons "CommandButton1" and "CommandButton2" and I see the textbox that I created "TextBox 1". I've tried renaming it to TextBox1 (removed the space). I know it's something silly. Can anyone help?
Private Sub CommandButton1_Click()
Dim AppConf As String
AppConf = "Test text" & vbCrLf
AppConf = AppConf & "More Text" & vbCrLf
TextBox1.Text = AppConf
and then it gives me the error