I have recently converted to Accpac Version 5.4 and I am finding my macros involving web reports and those that are launched from Excel no longer work.
Did something change with 5.4? They work with 5.3 perfectly.
Some example code not working anymore:
This macro runs a report and right after all of the parameters are set I have the following:
Dim webprinter As classwebprinter
Set webprinter = New classwebprinter
webprinter.printwebreport rpt
Then I have a class module called classwebprinter that has the following code:
Public Sub printwebreport(myrpt As AccpacCOMAPI.AccpacReport)
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Dim bconfirm As Boolean
bconfirm = myrpt.Confirm(True, 0)
If (bconfirm = True) Then
Dim bwebrpt As Boolean
bwebrpt = myrpt.PrintReport
If (bwebrpt = True) Then
Set MyFile = fso.GetFile(myrpt.SaveWebReportToLocal(REPORT_PDF))
MyFile.Copy filename
'Remove pdf from local settings folder
Kill myrpt.SaveWebReportToLocal(REPORT_PDF)
End If
End If
End Sub
This works fine in 5.3 but not at all in 5.4.
Any suggestions?
Did something change with 5.4? They work with 5.3 perfectly.
Some example code not working anymore:
This macro runs a report and right after all of the parameters are set I have the following:
Dim webprinter As classwebprinter
Set webprinter = New classwebprinter
webprinter.printwebreport rpt
Then I have a class module called classwebprinter that has the following code:
Public Sub printwebreport(myrpt As AccpacCOMAPI.AccpacReport)
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Dim bconfirm As Boolean
bconfirm = myrpt.Confirm(True, 0)
If (bconfirm = True) Then
Dim bwebrpt As Boolean
bwebrpt = myrpt.PrintReport
If (bwebrpt = True) Then
Set MyFile = fso.GetFile(myrpt.SaveWebReportToLocal(REPORT_PDF))
MyFile.Copy filename
'Remove pdf from local settings folder
Kill myrpt.SaveWebReportToLocal(REPORT_PDF)
End If
End If
End Sub
This works fine in 5.3 but not at all in 5.4.
Any suggestions?