Bloomberg BDH Refresh Via Macro Loop Application.Ontime

Dec 10, 2009

Firstly you don't need to know anything about Bloomberg to answer this query, only that Bloomberg has various functions that take time to update.

The code Application.Run "RefreshEntireWorkbook" will update these functions but Application.OnTime (Now + TimeValue("00:00:25")), "RunList" is required to allow them time to get the data from the feed. However this only works if the refresh and wait commands are in a seperate function. So in simplified terms it must go like this in vba:

View 2 Replies


ADVERTISEMENT

Refresh All Bloomberg Data Using Macro Or VBA

Jun 24, 2014

I attempted doing this by recording the macro but the macro doesn't read me clicking onto Bloomberg Refresh Data Button. How can I do this using VBA?

View 1 Replies View Related

Macro To Force Refresh Bloomberg Data

Feb 8, 2007

I have a workbook that pulls in index data from Bloomberg, most data is updated realtime, but one index we track is only updated late at night. I want to write a macro that will refresh all of the data in the worksheet and then save a snapshot of the workbook. I have all the code for saving the snapshot, but getting the data for the one index to refresh is proving difficult. None of the standard ways I know to refresh external data (both Excel commands via tools menu, and Bloomberg specific refresh commands) seem to work on these cells. The only way so far I've found to get these cells to pull in current data is to delete them and rewrite the formulas.

suggestion for a Macro that would force a refresh of this data?

View 7 Replies View Related

Application.ontime With A Macro That Needs Parameters

Jun 25, 2009

Is it possible to use a macro that needs parmeters as part of an application.ontime instruction? - I am getting a macro cannot be found error message.
If I change the called macro so that parameters are not required, it is found OK (but obviously isn't doing what I want anymore!).

I reckon it is something to do with the quotations around the macro name

View 9 Replies View Related

Macro To Loop Bloomberg Formula

Aug 21, 2014

i have the following macro that loops through 100 tickers in sheet 1, gets the trades for each, pushes each ticker's trades to sheet 2 to create a list of all trades. The problem is that I just get a #N/A requesting data for each ticker. This seems to be a wider problem with fetching external data from Bloomberg. However, I cannot seem to get a fix for it.

Sub Macro()
On Error Resume Next
Sheet2.Range("B3:E65536").ClearContents

[code]....

View 1 Replies View Related

Application.OnTime Not Stopping

Nov 3, 2006

I am running a timer in XL using the Application .OnTime Method.

Everywhere I've looked tells me that the procedure to stop the timer is

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, schedule:=False
End Sub

I have this code in with the timer, but when I hit F5 or go to Tools--->Macros--> and Run the StopTimer Macro the timer just keeps running.

how I can properly call this procedure and stop the timer?

View 9 Replies View Related

Repeat Application.ontime

Apr 26, 2007

how to repeat the following line?

Private Sub Workbook_Open()
Application .OnTime TimeValue("22:02:00"), "Email"

so that everyday it runs at the same time Everyday? At the moment i have to close the workbook at somepoint during the day then relaunch so that it picks this line up, when this eventually "goes live" it will not be monitored as closely as it does now during testing.

View 2 Replies View Related

Application Ontime - Stopping It?

May 25, 2007

I'm using Application OnTime to fire a procedure every 30 mins. It works great, but the workbook tries to reopen itself when i close it (but not if i close excel entirely). I assume this is because I haven't stopped it anywhere. So I put a call to a procedure that has: Application.OnTime RunWhen, cRunWhat, , False

In the "Workbook_BeforeClose" event. This doesn't solve the problem. What am I missing?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopTimer
End Sub

Private Sub Workbook_Open()
StartTimer
End Sub

(module1)

Public RunWhen As Double
Public Const cRunIntervalSeconds = 1800 ' thirty mins
Public Const cRunWhat = "dothis"...............................

View 8 Replies View Related

Close Workbook With Application.OnTime

Jul 28, 2009

I didn't receive a response to a previous post where I was trying to use a batch file to close and open a workbook at a scheduled time everyday. I was thinking about this problem over the weekend, and thought that it would probably be easier to just use a macro to close the file at a certain time everyday (if it is open) and then use a batch file to open the file a couple of minutes later.

I'm having problems with what I thought should be pretty simple though. I tried this to close the file at 5:15pm

View 14 Replies View Related

VBA In Constant Loop When Try To Refresh Other Pivot Tables

Jul 18, 2012

I have this code in an active worksheet that works with the exception that when I try refresh other Pivot Tables with the file that it goes into a constant loop.

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Update the pivot table on this worksheet if data in columns A or B is changed
'
If (Target.Column = 1) Or (Target.Column = 2) Then
ActiveSheet.PivotTables(1).RefreshTable
End If
End Sub

View 2 Replies View Related

Loop Through Array In VBA To Refresh Pivot Tables

Jul 24, 2014

I'm hoping to automate some pivot table refreshes. I've got a dozen pivot tables on a sheet all with different numbers. I'm hoping I can write a code that loops through the pivot table names and runs the refresh. Here is the code as it is right now. I've essentially copied, pasted, and changed the name of the pivot table for the refresh.

I would like to create an array in vba (22,21,20,19,18...) that renames the PivotTable and runs the code.

sub Refresh ()
Dim pt4 As PivotTable
Dim Field4 As PivotField
Dim NewCat4 As String

Set pt4 = ActiveSheet.PivotTables("PivotTable22")

[Code] ..........

View 3 Replies View Related

Add An Ontime Function To A Macro

Oct 17, 2008

I'm using this to unhide rows one at a time:

View 4 Replies View Related

Ontime Run Macro On The First Of The Month

Mar 1, 2007

I have 80 worksheets in my workbook, each worksheet contains a table which must be updated on the first day of each month. On each sheet I need vba to duplicate the value in cell A10 to replace the next zero value in column E; duplicate the value in cell F10 to replace the next zero value in column J. Then, continue the same operation on the next sheet.

View 3 Replies View Related

Refresh Input Cell And Capture All Outputs From Each Loop

Jul 10, 2014

Assuming I have three worksheets:

1) input: col A has a series of product code (string)
2) calculation: where I want to automatically copy and paste each product code from "input" worksheet into "calculation" cell B4, and through many steps of calculations, return the outputs in cell B8 and B9 (parameters are numeric)
3) output: how to automatically record B8 and B9 from "calculation" sheet to this sheet Row 5 and 6 from each loop? (format of output doesn't really matters)

View 4 Replies View Related

Each Loop Says Object Or Application Defined Error

Aug 7, 2014

I am trying to run for_each_loop to in a module run an activity on other excel file.

Other excel file is having 8 sheets and loop is working fine till 4th. but when loop goes to 5th sheet it says Application defined or object defined error. I am confused because i have defined the objestSh as worksheet in the beginning.

This line of code creating problem.

Sh.Range("A2").CurrentRegion.SpecialCells(xlCellTypeVisible).Offset(1, 0).Copy

View 1 Replies View Related

Stop OnTime Method Macro

Aug 5, 2007

I have 2 macros, each called by the other to keep updates fast as per below,

Sub Macro1()
Cells.Replace What:=",29", Replacement:=",30", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Application .OnTime Now() + TimeValue("00:00:01"), "Macro2"
End Sub

Sub Macro2()
Cells.Replace What:=",30", Replacement:=",29", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Application.OnTime Now() + TimeValue("00:00:01"), "Macro1"
End Sub

I need to create a separate macro I can run to permanently stop these two cycling. And allow me to use Excel. Then, when I wish for these to cycle again, I simply run that macro.

View 4 Replies View Related

Code For File Directory Loop - Use Of Application.Filesearch

Feb 11, 2009


I have been trying to process Excel files in a directory with the following

Sub FindExcelFiles()
Dim foldername As String
Dim FSO As Object
Dim fldr As Object
Dim file As Object
Dim cnt As Long
foldername = "c:usersseagreendesktopTuesdayFeb102009week ending feb 7 2009 esting2"
Set FSO = CreateObject("Scripting.FilesystemObject")
Set fldr = FSO.GetFolder(foldername)
For Each file In fldr.Files
If file.Type Like "*Microsoft Office Excel*" Then
cnt = cnt + 1
End If
Application.StatusBar = "Now working on " & ActiveWorkbook.FullName
DoSomething ActiveWorkbook
Next file
Set file = Nothing
Set fldr = Nothing
Set FSO = Nothing
Range("A1").Value = cnt
End Sub
Here's the stub for the subroutine that's being called:


Sub DoSomething(inBook As Workbook) 'Massage each workbook
'Debug.Print "Hello"
Debug.Print ActiveWorkbook.FullName
End Sub
I am using Excel 2007. I found out I cannot use Application.Filesearch as Microsoft has dropped this method for 2007. My problem now is that I just see "Now working on c:usersseagreendesktopTuesdayFeb102009week ending feb 7 2009 esting2file1.xls written six times in the immediate window.

View 9 Replies View Related

Stopping Ontime Macro At Fixed Time

Sep 15, 2014

I have the following macro that runs every time the system clock's second changes to 07 seconds. I however want it to stop running at 09:47 am. I have the code to stop the timer also (given below) but I am unable to stop the loop at 09:47 am. How do I do that?

VB:
Sub Timer()With Workbooks("book3.xlsm").Sheets("Sheet1")
Range("B10:E10").ClearContents
End With
Application.OnTime DateAdd("n", 1, CDate(Left(Now, Len(Now) - 2) & "07")), "Timer"
End Sub

[Code] .....

View 2 Replies View Related

Stop, Cancel OnTime Event Macro

Nov 11, 2006

I have a real simple question about what command to enter in order to stop a macro. All the macro does is "press the F9 key" every second. I use a button to start the loop but I am unable to find a way to use another button to stop the process. Ive copied my macro below:

Sub Go()
Calculate
Application .OnTime Now + TimeValue("00:00:01"), "Go"
End Sub

Private Sub CommandButton1_Click() "Go Button"
Application.OnTime Now + TimeValue("00:00:01"), "Go"
End Sub

Private Sub CommandButton2_Click() "Stop Button"
'????????????????????????
End Sub

View 2 Replies View Related

Excel 2010 :: OnTime Macro Stops Running When Window Minimized

Dec 12, 2013

I am using Excel2010.

My sheet displays values collected from a database via an AddIn. The values are updated by pressing CTRL+G (AddIn function).

I have an OnTime macro running SendKeys "^G" to update the values every minute. When the values exceed a certain limit, a sound is played from a custom Alarm function.

This all works as long as the excel window is active.

But if excel is minimized or another window is opened, the values stop updating until Excel is active again.

When the values dont update the sound is not played and that defeats the purpose of the sheet.

View 6 Replies View Related

Pivot Refresh After ODBC Query Complete Refresh

Jan 4, 2008

I have a query with ODBC connection to a SQL database. This query's parameter is linked to a cell. The resultant data is the source for a pivot table. I want to refresh the pivot table, when the query is run. I've tried using the cell that triggers the query....but the problem is that the query takes about 10 seconds to run. By the time the query returns new data....the pivot has already refreshed. I need it to refresh AFTER the query is complete.

I tried adding a cell that sums up the data from the query...thinking when THAT changes (due to updated data), to trigger the pivot refresh. Problem is that I don't know the trigger for when the sum cell changes (ie....formula change, not typed in.)

View 9 Replies View Related

Being Able To Refresh Data- So That When I Hit Refresh It Gets Info Frm Another File

Jul 27, 2006

i have an excel spreadsheet with 27 or so workeets. it contains sales figures in it.
I want to be able to link mutiple cells of this workbook to another workbook so that it retreives that data, So that when I hit the refresh (!) button it will automatically put the data in. I will recieve new sales figures (new files) on a monthly basis so i want it to be able to update the figures to the new figures.

View 4 Replies View Related

Excel VBA Pausing For Bloomberg?

Apr 30, 2014

Trying to create a macro where it will begin by inserting today's date into a cell, then pause for roughly 35 seconds while the massive correlation matrix pulls all the correlations of the portfolio in, then takes an output value that is generated in the workbook from the filled correlation matrix (correlation coefficient) and copy's and pastes it in a different cell. Then it repeats this process again using "Today's date - 1" (yesterday's date), waiting 35 seconds again and taking the new output value and copy and pasting it below the previous one.

I know I am not close but here is what I have for code thus far (which does not work properly).

[Code].....

View 4 Replies View Related

API Bloomberg (trying To Use BLP_DATA_CTRLLib.BlpData)

Jul 9, 2009

I have a problem with this this code trying to use BLP_DATA_CTRLLib.BlpData.

Sub MultidayHistory()

Dim objDataControl As BLP_DATA_CTRLLib.BlpData
Set objDataControl = New BlpData
Debug.Print "Formulaire Ouvert"

Dim vtResult() As Variant
Dim arrayFields As Variant
Dim vtSecurities() As Variant
Dim CalculDate As Date ' rien à voir avec cdate
Startd = Range("C10").Value
Endd = Range("C11").Value

arrayFields = Array("PX_LAST", "PX_VOLUME", "SPOT_PRICE", "CHG_NET_1D", "CHG_PCT_1D")
arraySecurities = Array("GLE FP Equity", "SX5P Index")......................

View 2 Replies View Related

Loading Data From Bloomberg

Dec 3, 2008

I hope there's someone who's familiar with Bloomberg in this forum.

My problem is, I have a template which conducts checks with data extracted a Bloomberg Terminal. I want to ensure that all data has FULLY loaded before I execute the checks.

So is there a way to detect if data is still loading?

Like for example, I need data to load from A1:A100, but data has only populated until A50. In this case I need to know that the other 50 cells are still populating.

View 9 Replies View Related

Data Retrieved From Bloomberg

Jan 5, 2009

refer to the picture:

Column H and column X contain dates. If column H = column X, "OK" will be shown. Otherwise "CHECK" would be shown.

The dates are the same, but the problem is, Excel reads column X differently from column H.

I've tried converting both columns to ddmmyyyy and then comparing them, but it doesn't work.

For i = 2 To range("A" & rows.count).end(xlup).row

If Format(Cells(i, 24), "ddmmyyyy") = Format(Cells(i, 8), "ddmmyyyy") Then
Cells(i, 36) = "OK"
Else
Cells(i, 36) = "CHECK"
End If

Next

Is there a foolproof way of doing it?

Column X is data retrieved from Bloomberg, so the format cannot be changed directly.

View 9 Replies View Related

Import Bloomberg Data

Aug 5, 2007

If it is actually not possible to change the way that bloomberg exports the information to excel then i think there might be two potential ways around it...neither of which i am sure how to do...

1) write some sort of macro which takes data from the new workbook, pastes it into the active workbook then closes the newly created workbook. Potential problem here is that whenever it creates a new workbook it has a slightly different name. eg. "abc1" then "abc2" etc.

2) Write some sort of macro which gets a list of companies from bloomberg with upcoming events over the next week, put this into the active workbook and then simply use the bloomberg get functions to fill out the info.

View 2 Replies View Related

Macro Refresh To Different Cells

Nov 27, 2008

I've recently got into using excel for more complicated work but still have a less than basic knowledge as I'm attempting to teach myself through trial and error. What I'm currently working on is a simple macro that downloads data from a website (which I've done) but ideally I'd like to have this macro recreate the data roughly every 30 seconds/minute and also have this data recorded next to the existing data rather than on top of it. I realise that you can import data from the web using the standard tools and can set it to reset every 60 seconds but I don't think you can get it to reload the data next to it which is why I was considering a macro.

View 10 Replies View Related

How To Add A Bloomberg BDP Function To Lookup Statement

Oct 16, 2012

I need to add a Bloomberg BDP function to my lookup statement. The formula that i'm trying to replicate in VBA is =IF(ISBLANK(h23,"",BDP(H23&" cusip","long_comp_name")). update my macro.

View 9 Replies View Related

Excel Looping With Bloomberg And Pause

Apr 30, 2014

I have an excel workbook right now with a 75x75 correlation matrix. It has 75 stock prices and uses bloomberg to pull in the correlation between each of the holdings. There is a lot of data so it takes roughly 35 seconds for it all to get pulled in from bloomberg. The input value that I can change is the date. The output value is a specific correlation coefficient. Thus, if I input today's date into a cell in the file, it will run the correlation matrix and tell me the correlation between all the holdings using the past year's data. Then it will produce a single output value.

I am now looking to use VBA to make this more robust. What I have been trying to do is have a macro which will -

(1) input the current date into the input cell
(2) have the code wait 35 seconds (and since it is using bloomberg pull in the traditional wait methods do not work because they actually stop the data pull in also)
(3) copy the output value
(4) paste special that value in a different cell
(5) repeat the process but this time use the date from a day before and have the output value copied and pasted to a cell below the previous one.

This loop would continue over 20 times.

Below I have some code that allows me to do this process once but is not looped and I have been stuck trying to make this work with a loop given the bloomberg delay. When I add a loop, it does not wait the 35 seconds I need before doing the whole process again.

[Code] .....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved