I am automating a batch print process (50 reports) using Excel/VB. The process aborts partially through the procedure with the following error message...
The instruction at "0x77fcbb5c" referenced memory at "0xffe00037". The memory count not be "written".
The instruction and memory location vary each time I run the procedure. The point at which the procedure aborts is different each time.
The latest Crystal SP's have been applied. Crystal Reports 8.5 ActiveX Designer Run Time Library and Crystal Reports 8.5 ActiveX Designer Design and Runtime Libraryreferences are included in the VB project.
Here is a sample of the code... Any Help will be appreciated. The frustration level increases geometrically with time!... Thanks!
============================================================
Etc.....
The instruction at "0x77fcbb5c" referenced memory at "0xffe00037". The memory count not be "written".
The instruction and memory location vary each time I run the procedure. The point at which the procedure aborts is different each time.
The latest Crystal SP's have been applied. Crystal Reports 8.5 ActiveX Designer Run Time Library and Crystal Reports 8.5 ActiveX Designer Design and Runtime Libraryreferences are included in the VB project.
Here is a sample of the code... Any Help will be appreciated. The frustration level increases geometrically with time!... Thanks!
============================================================
Code:
Dim crreport As CRAXDRT.Report
Dim crapplication As New CRAXDRT.Application
Dim reportfile As String
Dim FromPeriod As String
Dim ToPeriod As String
Dim Account As String
Dim Orientation As Integer
Dim PaperSize As Integer
Dim Copies As Integer
Sheets("PrintGandA").Activate
FromPeriod = Range("$C$7").Value
ToPeriod = Range("$C$8").Value
Copies = Range("$C$9").Value
crapplication.LogOnServer "pdsodbc.dll", "APP", "USR", "APP", "APPPWD"
' FIRST REPORT...
' ===============
Account = "751020"
reportfile = "S:T0_T4.rpt"
Set crreport = crapplication.OpenReport(reportfile)
Orientation = crreport.PaperOrientation
PaperSize = crreport.PaperSize
' Clear Parms
' ===========
crreport.ParameterFields.GetItemByName("FromPeriod").ClearCurrentValueAndRange
crreport.ParameterFields.GetItemByName("ToPeriod").ClearCurrentValueAndRange
crreport.ParameterFields.GetItemByName("AccountCode").ClearCurrentValueAndRange
' Add Parms
' =========
crreport.ParameterFields.GetItemByName("FromPeriod").AddCurrentValue (FromPeriod)
crreport.ParameterFields.GetItemByName("ToPeriod").AddCurrentValue (ToPeriod)
crreport.ParameterFields.GetItemByName("AccountCode").AddCurrentValue (Account)
crreport.PrintOut False, Copies, True
Etc.....