+ Reply to Thread
Results 1 to 2 of 2

Run-time error '-2146232576 (80131700)'

  1. #1
    Registered User
    Join Date
    11-25-2021
    Location
    England
    MS-Off Ver
    2110 Build 16.0.14527.20270
    Posts
    1

    Run-time error '-2146232576 (80131700)'

    Hi all,

    First time posting here, apologies if the formatting is incorrect. I have been using the same macro on 3 or 4 computers for a couple of years, all it is doing is selecting a random set of data based on the quanity specified on a different sheet. The script is called from a much larger script. Since the most recent update of office 365 (to the white poster on startup rather than the green one) it fails on a single line.

    When I click debug it is the line, With CreateObject("System.Collections.SortedList"), where the error occurs. This particular line is used in a few other places in the larger script at it fails in all subs but I can't figure out why. It still works on a PC with Excel (Version 2110 Build 16.0.14527.20234) 32-bit but fails on (Version 2110 Build 16.0.14527.20270) 64-bit.

    Sub getproducts()

    Dim Rng As Range, i2 As Long, sku_qty As Integer
    sku_qty = Worksheets("Working").Range("I5").Value

    Set Rng = Sheets("Products").Range("a1").CurrentRegion
    Sheets("Random Products").Range("a1").CurrentRegion.Offset(1).ClearContents

    With CreateObject("System.Collections.SortedList")
    Randomize
    For I = 2 To Rng.Rows.Count
    .Item(Rnd) = Rng.Rows(I).Value
    Next
    For I = 0 To Application.Min(sku_qty - 1, .Count - 1)
    Sheets("Random Products").Cells(I + 2, "a") _
    .Resize(, Rng.Columns.Count).Value = .GetByIndex(I)
    Next
    End With

    End Sub

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Run-time error '-2146232576 (80131700)'

    Others that have had the same problem have installed Microsoft .NET Framework 3.5 to fix it. Perhaps that solution might also work here? You can get it from here:

    https://docs.microsoft.com/en-us/dot...net-35-windows

    WBD
    Office 365 on Windows 11, looking for rep!

+ 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. Run Time error '-2146232576 (80131700)': Automation error
    By Vivek2705 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2021, 05:36 AM
  2. Run time error 2146232576 (80131700) - Automation Error
    By bala04msw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2018, 07:05 PM
  3. REPOSTING THREAD: Run time error 2146232576 (80131700) - Automation Error
    By bala04msw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2018, 07:39 AM
  4. VBA ERROR: run time error 1004: Application-defined or Object-defined error in excel 2013
    By AnanthKrishna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2015, 06:16 AM
  5. Cannot Publish Excel Pivot Chart - Run Time Error
    By crisb184 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2013, 07:04 AM
  6. run-time error ;2147023179 (800706b5) time automation error interface unknown
    By karthik72 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-02-2012, 09:31 AM
  7. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM

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