Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macros in version 5.4

Status
Not open for further replies.

mdewis

Technical User
Jun 7, 2006
23
CA
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?
 
Are the reports generating the data correctly before you get to the code above? Some reports have different parameters fro 5.3 so your code to populate the parameters may have to be updated.
 
Yes, the report parameters have been updated and the report generates properly on the desktop version.

The error I get specifically is...

Run-Time error '-2147467259 (80004005)':
Method 'SaveWebReportToLocal' of object 'IAccpacReport' failed.

Any ideas?
 
Anything in the event log? You might also use Process Monitor to see what the OS is doing when the failure occurs.
 
I went and found the Accpac Spy tool and I monitored the AccpacCOMAPI Report. The second last line says this:

(SaveWebReportToLocal) Not a web report, HRESULT=0x80004005

Am I looking in the right place?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top