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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

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