VBA Code to run Macro for Bloomberg

cheesymango

New Member
Joined
Oct 24, 2016
Messages
4
Hi guys! I'm very new to this so i hope i'm following posting rules! Have a simple question (probably for you experts!) - i have a spreadsheet which task scheduler opens and runs a macro. However, i'm having problems with the macro. I need the spreadsheet which contains a bloomberg addin bdh to "refresh" and save every day. I've went through multiple forums and they say the key to this is to add a time delay as bloomberg needs time to refresh the data? Would anyone be able to create a simple code to refresh the spreadsheet? I haven't dealt with bloomberg before so i do not know how to code this into vba - any help would be much appreciated, thank you!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I not quite sure what you mean by refresh and I haven't ever used bloomberg. But if you are looking for a simple update in your workbook i.e. if you your cell values may have changed due to the macro running then you can try the below. You will have to replace the 0's with the time delay you want - format is (Hours, Minutes, Seconds)

If this isn't what you are looking for hopefully it will point you in the right direction

Code:
Sub Calc()
    With ThisWorkbook
        Application.Calculation = xlCalculationManual
        Application.Calculation = xlCalculationAutomatic
    End With
    Application.OnTime Now + TimeSerial(0, 0, 0), "Calc"
End Sub

this is to turn it off

Code:
Sub CalcOFF()
    Dim wb As Workbook
        For Each wb In Workbooks
            End
        Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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