glfiedler
Board Regular
- Joined
- Apr 1, 2019
- Messages
- 67
- Office Version
- 365
- Platform
- Windows
I use office 365 on a windows 10 system that Microsoft automatically updated yesterday.
An excel project I wrote some 18 years ago is, today, having issues with userform textboxes. This project has worked well for years and the vba errors occurring today have not been modified.
The error is "type mismatch".
Back so many years ago when I was just learning vba programming I was not aware of the slight difference between the "value" and "text" properties of textboxes. I have learned much over the years, thanks to many of you on this forum, and I thought I now had a pretty good idea of the difference.
Here is a typical section of code where the User enters some text along with a dollar amount in a userform textbox. The code basically changes the sign of the dollar amount and places the text and amount in a worksheet.
I changed the code, today, by replacing .text with .value in the "amount" equation:
I still get the mismatch error. Do any of you have any ideas why this is not working?
An excel project I wrote some 18 years ago is, today, having issues with userform textboxes. This project has worked well for years and the vba errors occurring today have not been modified.
The error is "type mismatch".
Back so many years ago when I was just learning vba programming I was not aware of the slight difference between the "value" and "text" properties of textboxes. I have learned much over the years, thanks to many of you on this forum, and I thought I now had a pretty good idea of the difference.
Here is a typical section of code where the User enters some text along with a dollar amount in a userform textbox. The code basically changes the sign of the dollar amount and places the text and amount in a worksheet.
VBA Code:
With Checking.Range("iDiscoverDate")
.Offset(blank, 0).Value = PurchaseFM.ActionDate.Text
.Offset(blank, 1).Value = PurchaseFM.PurDescription.Text
.Offset(blank, 2).Value = PurchaseFM.Amount.Text * -1
End With
VBA Code:
With Checking.Range("iDiscoverDate")
.Offset(blank, 0).Value = PurchaseFM.ActionDate.Text
.Offset(blank, 1).Value = PurchaseFM.PurDescription.Text
.Offset(blank, 2).Value = PurchaseFM.Amount.Value * -1
End With