Forum Discussion
cmlobo_sr_sf
Aug 10, 2020Copper Contributor
vba microsoft.mashup.oledb.1 provider is not registered on the local machine
Hello, some moths ago the following vba script stop working: sub auto_open ActiveWorkbook.Connections("Query - Query1").Refresh end sub the error message is : microsoft.mashup.oled...
- Sep 14, 2020
Hi Carlos,
May I recommend you to have the following changes:
1. Update auto_open as follow
sub auto_open
ActiveWorkbook.RefreshAll
end sub
2. Uncheck "Refresh this connection on Refresh All" property for all the queries you want to refresh by code (i.e. Query1, Query2 etc.)
This solution works for me.
Cheers,
Brian
chris1117
Sep 09, 2020Copper Contributor
I believe something in the latest update made it so the .netframework doesn't automatically load on workbooks that contain queries.
I got around this by adding a blank query and setting it to load on open. This way the framework loads when you open the book.
I run many things from a vbscript in the background and this 'bug' broke them all!
- JosephDelliGattiJan 15, 2022Brass ContributorThanks. This was the workaround for me too. I created a query that calls on a single-cell named range in my workbook, and have it set to connection only. Then, I set the properties to refresh on file open. It works.
I think the issue is that when it's not loaded at open, then my last query (which is the one my macro calls on) tries to run the query without refreshing its parent query properly. Somehow, this blank query starts the framework as you described, and then allows the child query to refresh the parent query properly. That's my best guess.