Refresh without physically moving to the data tab? VBA code listed.

zpsale01

New Member
Joined
Jul 10, 2014
Messages
12
I have an activeX Combobox that when a change event occurs it refreshes a data tab titled Expenses.

this refresh uses the hypretrieve smartview VBA script.
this function currently works but when the refresh occurs the user is moved to the data sheet while it refreshes and then back to the report.

is it possible to make the refresh occur in the background?

also, if i wanted to hide the sheet, could i unhide refresh, then hide again, all while the user can only see the report screen?

VBA code below.

Actual Macro

Declare Function HypRetrieve Lib "HsAddin" (ByVal vtSheetName As Variant) As Long
Sub RetrieveData()
sts = HypRetrieve("Expenses")

End Sub

Combobox Change Event

Private Sub ComboBox1_Change()
Call RetrieveData
End Sub

Thanks for all your insight!!!

greatly appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try this:
Code:
Declare Function HypRetrieve Lib "HsAddin" (ByVal vtSheetName As Variant) As Long
'Actual Macro
Sub RetrieveData()
    Application.ScreenUpdating = False
    Worksheets("Expenses").Visible = True
    sts = HypRetrieve("Expenses")
    Worksheets("Expenses").Visible = False
    Application.ScreenUpdating = True
End Sub
Code:
'Combobox Change Event
Private Sub ComboBox1_Change()
    Call RetrieveData
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top