Whenever I run the below code I get a run-time error.
'-2147190908 (80047784)':
Failed to export the report.
But if I change crxReport.Export (False) to
crxReport.Export (True)
and do everything by mouse it works.
As far as I can see all the variables are correct.
ie the profile,username,password etc etc
Any idea's ?
------------------------------------------------------------
Private Sub Form_Load()
Dim crxReport As CRAXDRT.Report
Dim crxapplication As New CRAXDRT.Application
Set crxReport = crxapplication.OpenReport("D:\Projects\VB\Current Source\Report\machine list alt.rpt"
With crxReport.ExportOptions
.DestinationType = crEDTEMailMAPI
.MailPassword = "jblogs87Ynh@"
.MailUserName = "jblogs" 'Also tried Domain\jblogs
.MailMessage = "Exported Report"
.MailSubject = "Weekly Document Status Report"
.MailToList = "Joe Blogs"
.ExchangeProfile = "Joe"
.FormatType = crEFTPortableDocFormat
.PDFExportAllPages = True
.DiskFileName = "c:\TEMP.pdf"
End With
crxReport.DiscardSavedData
crxReport.Export (False)
End Sub
------------------------------------------------------------
References:
Visual Basic for Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
Microsoft ActiveX Plugin
Microsoft ActiveX Data Objects Library
Crystal Reports 9 ActiveX Designer Run Time Library
'-2147190908 (80047784)':
Failed to export the report.
But if I change crxReport.Export (False) to
crxReport.Export (True)
and do everything by mouse it works.
As far as I can see all the variables are correct.
ie the profile,username,password etc etc
Any idea's ?
------------------------------------------------------------
Private Sub Form_Load()
Dim crxReport As CRAXDRT.Report
Dim crxapplication As New CRAXDRT.Application
Set crxReport = crxapplication.OpenReport("D:\Projects\VB\Current Source\Report\machine list alt.rpt"
With crxReport.ExportOptions
.DestinationType = crEDTEMailMAPI
.MailPassword = "jblogs87Ynh@"
.MailUserName = "jblogs" 'Also tried Domain\jblogs
.MailMessage = "Exported Report"
.MailSubject = "Weekly Document Status Report"
.MailToList = "Joe Blogs"
.ExchangeProfile = "Joe"
.FormatType = crEFTPortableDocFormat
.PDFExportAllPages = True
.DiskFileName = "c:\TEMP.pdf"
End With
crxReport.DiscardSavedData
crxReport.Export (False)
End Sub
------------------------------------------------------------
References:
Visual Basic for Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
Microsoft ActiveX Plugin
Microsoft ActiveX Data Objects Library
Crystal Reports 9 ActiveX Designer Run Time Library