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.
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.