VBA - Include Wait for Bloomberg's Calculations

reddevil00

New Member
Joined
Jul 3, 2014
Messages
11
Hi,

Using VBA, I've made an automating process where it takes values from the MasterSheet (Opened workbook) and save as pdf based on the name of Cell(row,2) value. I need to put a delay in this process as my excel is linked with Bloomberg Terminal, and excel requires 15 seconds for Bloomberg to complete its calculations on designated cells.

I'm wondering if you can help me include wait/delay timer, so that it opens an excel file and waits 15 sec before converting/saving into pdf.

Here's the code I have thus far (without wait/delay timer):

Sub convert()
Dim fname As String
Dim Filename As String
Dim Row, lastrow As Double


lastrow = Range("B" & Rows.Count).End(xlUp).Row

For Row = 2 To lastrow
Filename = "F:\VBA - " & Cells(Row, 2).Value & " final.xlsx"
fname = "F:\VBA - " & Cells(Row, 2).Value & " final.pdf"

Workbooks.Open Filename:=Filename
Application.DisplayAlerts = False
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=fname, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
ActiveWindow.Close
Next Row



End Sub


Thanks in advance for your help.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,216,084
Messages
6,128,728
Members
449,465
Latest member
TAKLAM

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