run-time error '2147417848 (800101108)Method 'Value' of object 'Range' failed

jbwilks6

New Member
Joined
Oct 29, 2022
Messages
6
Office Version
  1. 2019
Platform
  1. Windows
I am getting this error while trying to update cells in a worksheet from my textbox values on a form.

VBA Code:
Private Sub WriteDataToSheet()
    Dim newRow As Long
    With shMembers
        newRow = .Cells(.Rows.Count, 1).End(xlUp).row + 1
        .Cells(newRow, 1).Value = txtMemberId.Value
        .Cells(newRow, 2).Value = txtLastName.Value
        .Cells(newRow, 3).Value = txtFirstName.Value
    End With
End Sub

It fails on the line: .Cells(newRow, 1).Value = txtMemberId.Value

I have a copy of MSOffice 2019 professional but I keep getting the product is not genuine warning which I am not sure why because it should be genuine. I tried repairing and re-installing the office 2019 app but still getting the error.
So I am considering just updating to Office 365 to see if it fixes it, but I am wondering why this is necessary when I already purchased 2019 version.

Also, another related question is, If I am developing VBA/Excel applications, that could potentially be installed on a variety of client machines with different versions of windows or excel, what version of excel/office should I develop my apps on. What is the best practice for this situation?
 
Last edited by a moderator:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Where is this code? If on a sheet, you're missing the userform reference. If on the userform, I'd preface control name with Me as a habit.
Office 365 is subscription based, which will incur annual fee. I'd google the problem to see if there's something you can do with what you've got.
Usual practice is to develop with/for the oldest version you expect to encounter or are willing to support.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top