rangerstud620
Programmer
I've got a program that exports a Crystal Report as a CSV. Sometimes, but not always, I get a Run-Time error '-2147206396' Definition: Selected collating sequence not supported by the operating system. When I press Debug and then continue running the program, everything works fine. Below is the code I have in the program:
'Open report
Set Application = CreateObject("CrystalRuntime.application.9"
Set Report = Application.OpenReport("M:\VB Programs\Reports\Input Proofer\EclipseExport.rpt"
Set ExportOptions = Report.ExportOptions
'Set report spreadsheet location
Report.Database.Tables(1).SetTableLocation strOpenExcel, "", "Sheet1"
Report.Database.Verify
'Set report export properties
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.ExportOptions.DiskFileName = Mid(strOpenExcel, InStrRev(strOpenExcel, "\", -1) + 1, InStrRev(strOpenExcel, ".", -1) - (InStrRev(strOpenExcel, "\", -1) + 1)) & ".qa1"
Report.ExportOptions.FormatType = crEFTCommaSeparatedValues
Report.Export False 'This is what is highlighted
'when I press Debug
Does anyone have any ideas as to what the problem may be? Thanks!!
'Open report
Set Application = CreateObject("CrystalRuntime.application.9"
Set Report = Application.OpenReport("M:\VB Programs\Reports\Input Proofer\EclipseExport.rpt"
Set ExportOptions = Report.ExportOptions
'Set report spreadsheet location
Report.Database.Tables(1).SetTableLocation strOpenExcel, "", "Sheet1"
Report.Database.Verify
'Set report export properties
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.ExportOptions.DiskFileName = Mid(strOpenExcel, InStrRev(strOpenExcel, "\", -1) + 1, InStrRev(strOpenExcel, ".", -1) - (InStrRev(strOpenExcel, "\", -1) + 1)) & ".qa1"
Report.ExportOptions.FormatType = crEFTCommaSeparatedValues
Report.Export False 'This is what is highlighted
'when I press Debug
Does anyone have any ideas as to what the problem may be? Thanks!!