Guest
Guest
Guests
I'm using the code below, but my Do While Application.CalculationState <> xlDone is not working correctly. The macro tries to save the file before the Refresh All is completed.
Please provide a solution.
Sub RefreshAllConnections()
' Refresh all data connections in the workbook
ThisWorkbook.RefreshAll
' Wait for the refresh to complete before continuing
Do While Application.CalculationState <> xlDone
DoEvents
Loop
' Save the workbook after the refresh is complete
ThisWorkbook.Save
' Close the workbook
ThisWorkbook.Close SaveChanges:=False
End Sub
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 4
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1942
SunnyKow: 1432
Anders Sehlstedt: 935
Purfleet: 415
Hans Hallebeek: 360
Frans Visser: 349
David_Ng: 312
lea cohen: 248
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Sean McPoland
Brian Sutera
Naveed Naveed
Gary Horswell
Kirsten Godier
Joshua John Valdes
D B
Eric .
Michelle Francis
Gweneth Henderson
Forum Stats:
Groups: 3
Forums: 25
Topics: 7110
Posts: 31163
Member Stats:
Guest Posters: 50
Members: 34564
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —