Developing VBA apps and Excel versions

jbwilks6

New Member
Joined
Oct 29, 2022
Messages
6
Office Version
  1. 2019
Platform
  1. Windows
I am developing a vba/excel app for a client and trying to determine which version of excel I should develop it in. The client uses the following Office 365 version:
Microsoft® Excel® for Microsoft 365 MSO (Version 2210 Build 16.0.15726.20188) 64-bit

But I know online office 365 doesn't even allow for vba development.
So I started to develop in excel 2019 but kept getting errors in simple code:
run-time error '2147417848 (800101108)
Method 'Value' of object 'Range' failed

So I am planning to use a copy of Excel 2010 that I have. Will this work? What is the best practice to deploy vba apps. Will I just have to have the client install a local copy of Excel 2010?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
So I started to develop in excel 2019 but kept getting errors in simple code:
run-time error '2147417848 (800101108)
Method 'Value' of object 'Range' failed
What code are you using when you get that error as it isn't normally version dependent?
 
Upvote 0
It's when I try to update a worksheet range with values from textboxes on a user form. It fails on .Cells(newRow, 1).Value = txtMemberID.Value. Couldn't get around it. Googled, researched everywhere and can't find solution. So in my 2010 version it does not produce the error.


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
.Cells(newRow, 4).Value = txtStreet1.Value
.Cells(newRow, 5).Value = txtStreet2.Value
.Cells(newRow, 6).Value = txtStreet3.Value
.Cells(newRow, 7).Value = txtStreet4.Value
.Cells(newRow, 8).Value = txtCity.Value
.Cells(newRow, 9).Value = txtState.Value
.Cells(newRow, 10).Value = txtCountry.Value
.Cells(newRow, 11).Value = txtZipcode.Value
.Cells(newRow, 12).Value = txtEmail.Value
.Cells(newRow, 13).Value = txtStatementName.Value
.Cells(newRow, 14).Value = txtPhone.Value
End With
End Sub
 
Upvote 0
If your userform name is Userform1...
Code:
With Sheets("shMembers")
.Cells(newRow, 1).Value = Userform1.txtMemberID.Value
HTH. Dave
 
Upvote 0
If your userform name is Userform1...
Code:
With Sheets("shMembers")
.Cells(newRow, 1).Value = Userform1.txtMemberID.Value
HTH. Dave
Thanks for trying but still get the error. actually what your code does is call the userform initialize event again (which I don't want) and then execeutes the line and still gives the error. I can't find a resolution by anyone that has experienced this error. I am really wondering if using excel 2010 which doesn't give the error is really a good idea to develop applications to deploy on other's machines though
 
Upvote 0
Those were just 2 lines of code that I thought could be improved (ie. there are multiple lines without the userform1). Is this userform code? There is no way that it should cause the userform to initialize again? I would check to make sure that your sheet name, userform name and control(s) names are all correct. Dave
 
Upvote 0
Comment out that first line that you posted about and run your code... do you still get that error on the next line of code?
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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