Macro Run-Time Error

Copper Contributor

I have a spreadsheet that my team uses to generate templates by pulling data from our automation systems. It uses a macro to pull the requested information from a file on a server.

 

To use it, my VPN must be on and macros enabled, I have done both, but it doesn't work on my computer. This macro works on everyone else's computer in my team, except for mine. It just gives me the following error: 

 

Run-time error '-2146234341 (8013101b}:
Could not load file or assembly or one of its dependencies. This assembly is built by a runtime newer
than the currently loaded runtime and cannot loaded.

 

Can you please tell me how to address this issue and get the macro working? 

7 Replies

@sahrens 

The error message you’re seeing suggests that the macro is trying to load an assembly (a compiled code library) that was built with a newer version of the .NET Framework than the one currently installed on your computer.

To resolve this issue, you can try updating the .NET Framework on your computer to the latest version.

You can download the latest version of the .NET Framework from the Microsoft website.

Once you’ve installed it, restart your computer and try running the macro again.

If you continue to experience issues, you may want to reach out to your IT department for further assistance.

 

Hope this will help you.

Thanks for your response, I have downloaded the latest version (.NET Framework 4.8.1) and restarted my computer but I am getting the same error. Is there a way I can check which version of the .NET Framework that the assembly was built with, and check which version I am running to make sure the download worked properly?

Unfortunately my IT department says they won't help with Macro issues and forwarded me here, so I won't be able to get any help from them.

 Do you have Microsoft .NET Framework 3.5 installed on your PC?

If not, here are the links with the download and installation.

 

Install the .NET Framework 3.5 on Windows 11, Windows 10, Windows 8.1, and Windows 8

Download Microsoft .NET Framework 3.5

 

 

@sahrens

No I have 4.8.1 because that was the newest version available. 3.5 looks to be the oldest available version, which is the opposite of what you first suggested. Is there I reason why I should use 3.5 instead? @NikolinoDE 

Framework a working framework (as the name suggests) or a framework of software used by other programs to prevent those programs from reinstalling the same pieces over and over again. Framework is therefore a collection, which can also be called a library, of different drivers or programs, which in turn supports the functions of other programs.
This is the "substructure" for many programs.
Net 3.5 is actually only installed if a program requires it.
NET 4.8 is an integral part of Windows and is required for Windows and other programs.
If you decide to uninstall 4.8, you can reinstall Windows.
Okay, I installed the 4.8.1 version because you said:

"To resolve this issue, you can try updating the .NET Framework on your computer to the latest version."

But it is still not working, and I don't think that going back to an older .NET Framework (3.5) will solve the issue when the error message is:

"This assembly is built by a runtime NEWER than the currently loaded runtime and cannot be loaded."

So what could the root cause be in this case? Is the .NET not properly updated?

Is there a way I can check which version of the .NET Framework that the assembly was built with, and check which version I am running to make sure the download worked properly?

@sahrens 

One .NET version does not cancel out the other, as far as I know, both can be installed.  If this were or is as you say, then 4.8 would certainly cancel out 3.5 and not the other way around.

 

 If the issue persists even after installing the version 3.5 of .NET Framework, there are a few more steps you can try:

  1. Make sure all Windows updates are installed. To do this, open Windows Settings and navigate to “Update & Security”. Click on “Check for updates” and install any available updates.
  2. Check the Excel file for corrupted content. To do this, open the file in Excel and click on “File” > “Info” > “Check for Issues” > “Inspect Document”. Follow the instructions to repair any corrupted content.
  3. Disable all add-ins in Excel. To do this, open Excel and click on “File” > “Options” > “Add-ins”. Select “Excel Add-ins” from the drop-down menu and click on “Go”. Uncheck all add-ins and click on “OK”.
  4. Try running the macro in safe mode. To do this, hold down the Ctrl key while opening the Excel file. Click on “Yes” when asked if you want to continue in safe mode.

 

*If the issue persists, it would be useful to add a file (without sensitive data) with the problem to be able to say more precisely.

 

As far as I'm aware there is no way to use Excel directly to check the version of .NET Framework an assembly was built with and what version you are running. You could possibly try Visual Studio and use Clrver.exe tool.

 

Hope these Information helps!