+ Reply to Thread
Results 1 to 8 of 8

Runtime Error: run time error -2147417748(80010108)

  1. #1
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Runtime Error: run time error -2147417748(80010108)

    So im trying to create a data base with userforms and worksheets. Inside the worksheet, ive got a table where everytime I fill up textboxes, comboboxes etc. and click a button (everything inside a userform), the information within these objects is being saved in a new row under the table, and it becomes part of the table, but different columns, in the existing table.

    Right now Ive got a table with 100 rows and 63 columns. EVERY COLUMN IS FILLED WITH SOMETHING WHEN I CLICK THE BUTTON IN THE USERFORM.

    while testing, I had like 40 columns and everything was fine, I could create a new row at the bottom of the table and save the information Then, I added more columns until having 63.

    Now when I want to save the information, this error pops out:

    method cells of object _worksheet failed


    Apparently an automation error (which I have no idea what does that mean)

    So doing research, it might be something about connection issues or the size (kb) of my userform, or my userforms being ShowModal:=True.

    I set my userforms to Showmodal:= False, the size of my userform is no more than 35 kb, and as my understanding, the max size can be up top 64kb, so I dont think that's failing.

    When reviewing my table, I added a blank extra row manually and the error is gone. Seems like the program isn't recognizing any cell outside my table, which it did when I was testing with 40 columns, and is provoking this error.

    BUT... I didnt change the code when adding the columns, when I had 40 columns, everything worked, I even tried to explicit add a new row to my table and write on that row, but the same error keeps popping. Could be a loop somewhere?

    IMPORTANT INFORMATION: Every userform is set to ShowModal:= False, I have 15 userforms, right now i have 100 rows and 63 columns.
    Hope you can help, I've been trying to solve this issue for weeks

    Here's part of my code to write on the worksheet:
    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,166

    Re: Runtime Error: run time error -2147417748(80010108)

    I do not know for certain what your problem is. I suggest you attach your file. The paper clip icon does not work for attachments. Instead, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

    You are qualifying the worksheet name everywhere but one place. See change in red. That could be a problem but I doubt it is causing an automation error. However, it could be responsible for a "method cells of object _worksheet failed" error. What is the value of final when that error occurs?
    Please Login or Register  to view this content.
    This code isn't a bug but it bothers me. I do not recommend changing the value of a loop constraint inside the loop. This is not causing your error but here is an alternative:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Runtime Error: run time error -2147417748(80010108)

    So let's say I have 100 rows in a table. With a button and the exact same code I posted previously, I added those 100 rows. Now when I try to to add a new row with values in the table, there's this Automation Error but now, with the message "method default of object range failed". So because table ends at row 100, the app thinks im sending a wrong address to write values. I want to write on line 101, but because it isnt within the table, I get the error. Previously, when I wrote below the table, that new row became part of the table, just as I wanted to be.

    I solved the last error message "method cells of object _worksheet failed" by assigning object variables to workbook and worksheet.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,166

    Re: Runtime Error: run time error -2147417748(80010108)

    Did you make the changes I suggested just to see if it makes a difference?

    When the error occurs, do you have the option to enter debug mode? If so, what line of code does it stop on? What is the value of final when the error occurs?

  5. #5
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Runtime Error: run time error -2147417748(80010108)

    Yes I applied the changes, but those weren't the cause of the error as we already knew. I've got the option to debug. When I click Debug, the line where the error pops is this one

    'GRABAMOS ALTA NUEVO CLIENTE
    Worksheets("BaseDeDatos").Cells(final, 1) = ufNuevoCliente.tb_NumeroCliente.value 'ERROR LINE

    the final value is 102, as expected due to the headers of my table and having already 100 rows of data. The "method cells of object _worksheet failed" error was solved assigning variables as workbook and worksheets. Now Im getting this one "method default of object range failed", as I explained in my last rep, I dont know why Cells function is only accepting an address within my table, I cant add a new line of values.

  6. #6
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Runtime Error: run time error -2147417748(80010108)

    Maybe not a solution, but to get a better idea, if I grab the corner of my table in my worksheet, and I pull it down one row (add one row covering line 102), AND THEN I run the code, it succeeds. But obviously im not doing a manual resizing everytime I want to add data to my table

  7. #7
    Registered User
    Join Date
    09-08-2020
    Location
    Mexico
    MS-Off Ver
    360
    Posts
    1

    Re: Runtime Error: run time error -2147417748(80010108)

    Hello,

    I Know it's been a time, but I've got the same problem when adding new rows with the "add" method.

    How were you able to solve the problem?

    I really appreciate your kind answer.

    Thanks a lot!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Runtime Error: run time error -2147417748(80010108)

    Quote Originally Posted by Javsilcas View Post
    Hello,

    I Know it's been a time, but I've got the same problem when adding new rows with the "add" method.

    How were you able to solve the problem?

    I really appreciate your kind answer.

    Thanks a lot!
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Runtime error -2147417848 (80010108) Disconnected from client
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-08-2017, 10:04 AM
  2. error Runtime 2147417848(80010108)
    By shilva in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2017, 02:01 PM
  3. MACRO ERROR WITH EXCEL 2013 - Run-Time Error '-2147417848 (80010108)'
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2014, 11:07 AM
  4. [SOLVED] [SOLVED]VBA Sort Error-runtime error 2147417848(80010108)
    By sureshtrb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-30-2014, 12:59 PM
  5. Replies: 7
    Last Post: 05-15-2013, 09:02 AM
  6. Replies: 12
    Last Post: 04-15-2010, 08:20 PM
  7. Runtime Error -2147417848 (80010108)
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2006, 02:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1