Hello!
I am working in a tool to generate reports. I have created a form in one worksheet "Report" and when a change a cell values related to the tag, this form is be populated with the information related to that tag number.
I created the following code, but after the macro finish running, the pdf files are not saved anywhere.
NrTags is the total amount of reports that shall be printed.
Sub PrintWFCReport()
'
' PrintWFCReport Macro
' Prints the WFC Report for all Tags in .pdf file
'
Application.Calculation = xlAutomatic
Dim NrTags As Integer
Dim i As Integer
NrTags = Worksheets("Configurator").Range("B12").Value
Do
Worksheets("Report").Range("L3").Value = i
i = i + 1
Sheets("Report").Range("A1:I53").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\" & (Environ$("Username")) & "\Desktop\WFC Report - " & Sheets("Figures").Range("B3").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
Loop Until Worksheets("Report").Range("L3").Value = NrTags
Worksheets("Report").Range("L3").Value = 0
'
End Sub
The way this code should work is that i would get one report per tag. Also, if you can advise me in how to print all the reports in a single .pdf file it would be amazing!
Thanks!
I am working in a tool to generate reports. I have created a form in one worksheet "Report" and when a change a cell values related to the tag, this form is be populated with the information related to that tag number.
I created the following code, but after the macro finish running, the pdf files are not saved anywhere.
NrTags is the total amount of reports that shall be printed.
Sub PrintWFCReport()
'
' PrintWFCReport Macro
' Prints the WFC Report for all Tags in .pdf file
'
Application.Calculation = xlAutomatic
Dim NrTags As Integer
Dim i As Integer
NrTags = Worksheets("Configurator").Range("B12").Value
Do
Worksheets("Report").Range("L3").Value = i
i = i + 1
Sheets("Report").Range("A1:I53").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\" & (Environ$("Username")) & "\Desktop\WFC Report - " & Sheets("Figures").Range("B3").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
Loop Until Worksheets("Report").Range("L3").Value = NrTags
Worksheets("Report").Range("L3").Value = 0
'
End Sub
The way this code should work is that i would get one report per tag. Also, if you can advise me in how to print all the reports in a single .pdf file it would be amazing!
Thanks!