Forum Discussion
Jb Jeannot
Feb 20, 2018Copper Contributor
VBA Update different of UpdateAll from Excel
Hello !
I'm working on a personnal VBA code, and when I use this :
The result on my Excel isn't the same as my code on VBA when I debug. What is surprising is the fact that on an othe...
- Feb 22, 2018
What about this method then:
Sub RefreshUsingCommandbarbutton() Dim oCMB As CommandBar 'Add temporary commandbar Set oCMB = Application.CommandBars.Add("MyBar", msoBarPopup, False, True) 'Add refreshall button and click it With oCMB.Controls.Add(ID:=1952) .Execute End With 'Remove temporary commandbar Application.CommandBars("MyBar").Delete Set oCMB = Nothing End Sub
Jb Jeannot
Feb 21, 2018Copper Contributor
Hello Jan,
First, thanks for your answer.
I tried it, but the actualization isn't corresponding to my expectations.
When I debug line to line, my columns are updated normaly, and for the same code (exactly the same code on my cell), I got what I want. When I don't debug, and I refresh with "Refresh all", my datas are wrong. Is that possible to overload this button by VBA code ? What is the name of the associated function ?
Thank you !
JKPieterse
Feb 22, 2018Silver Contributor
What about this method then:
Sub RefreshUsingCommandbarbutton() Dim oCMB As CommandBar 'Add temporary commandbar Set oCMB = Application.CommandBars.Add("MyBar", msoBarPopup, False, True) 'Add refreshall button and click it With oCMB.Controls.Add(ID:=1952) .Execute End With 'Remove temporary commandbar Application.CommandBars("MyBar").Delete Set oCMB = Nothing End Sub
- Jb JeannotFeb 23, 2018Copper Contributor
Thank's for your help Jan !