Aug 10 2020 11:48 AM
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.oledb.1 provider is not registered on the local machine
Query1 its a power query connection
The Problem is that when the excel starts que .NET Framework isn't loaded.
the command : ActiveWorkbook.RefreshAll , works but i have multiple connections and want them updated in a specific order
i tried calling the command bar :
Application.CommandBars("Queries and Connections").Visible=True
it does not work
I tried loading the command bar using sendkeys :
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) 'For 64 Bit Systems
Sub refresh_sequence()
ActiveWorkbook.Sheets(1).Select
SendKeys "%apnl", True
Sleep 1000
ActiveWorkbook.Connections("Query - Query1").Refresh
ActiveWorkbook.Connections("Query - Query3").Refresh
ActiveWorkbook.Connections("Query - Query2").Refresh
End Sub
the sendkeys when alone it loads the command bar and NET Framework, but when i combined sendkeys with query Refresh, never got the net framework loaded before query refresh command could be executed.
I spent hour trying to find a solution but nothing ... i suspect that my inicial code spot working because an update of office 365
my office version is:
Version 2009 (build 13130.20000 click-to-Run)
Beta Channel
This excel files are automated reportes this a specific refresh sequence and now i cant update automatically, i am updating them manually and i am losing my mind
Best Regards
Carlos
Aug 20 2020 09:20 PM
Hello @cmlobo_sr_sf ,
Have you found a solution to this problem? I am experiencing the same issue.
Any help would greatly be appreciated.
Thanks
Sep 03 2020 06:27 PM
I face the same issue too not sure how to resolve it . using the Power Query
Sep 09 2020 05:42 AM
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!
Sep 09 2020 06:43 AM
Same issue.
Sep 09 2020 11:09 AM
Same issue here! I have a bunch of automated reports that have all stopped working!
Sep 09 2020 08:38 PM
I found a way that seems to enable my macro to work again, though im not sure why it works.
The method is:-
Go to the Queries connection and for the queries that had been setup, right-click and choose "properties" - under the refresh control , choose to tick the "Enable Fast Data Load" and untick the "Refresh this connection on Refresh All".
Sep 14 2020 12:09 AM
SolutionHi 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
Sep 24 2020 06:22 PM
I had the same issue as well. I tried something similar to your solution above, and it worked. I have >150 queries so would be unfeasible to apply your solution to each. See my solution below
Go to Data -> Get Data -> Query Options
Tick "Fast Data Load"
when I did this and saved my workbook all the macros started working again!
hope this helps others as well.
Jan 15 2022 12:25 AM
Sep 14 2020 12:09 AM
SolutionHi 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