1

I can successfully run a VBA script in a .xlsm file on my own computer but after moving the xlsm file to a different computer, that computer throws an automation error? So how do I fix it so the script runs on the other computer?

The xlsm contains a class module that implements the script described here: https://codereview.stackexchange.com/questions/196076/bringing-the-system-text-stringbuilder-up-to-lightning-speed-in-the-vba I think this maybe a framework.NET issue so I have installed the System.Text onto the other computer (via installation of VS) and successfully tested it through a really simple C# command console. The VBA code that fails is the following (in the Class_Initialize sub-routine):

Set m.Builder = CreateObject("System.Text.StringBuilder")

When I attempt to run the VBA I get a message box with the following content:

Run-time error '-2146232576 (80131700)' Automation error

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
greenbeast
  • 364
  • 2
  • 8
  • 21

1 Answers1

2

So I followed the successful answer given in this post: automation error -2146232576 (80131700) on creating an array

It worked for me too.

I needed to install .NET Framework 3.5 which I did by following the advice given here: https://learn.microsoft.com/en-us/dotnet/framework/install/dotnet-35-windows-10

greenbeast
  • 364
  • 2
  • 8
  • 21