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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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