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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating Export to Excel from VB code

Status
Not open for further replies.

nickfatool

IS-IT--Management
Oct 8, 2001
30
0
0
AU
CR8.5Dev, VB6, ODBC

Are the Crystal export functions controllable by VB code?
I have a report that is always exported to Excel, always "7.0 Extended" and Column width always based on Page Header, plus I'd also like to control the resulting file name via code as well.

This would save users a few extra keystrokes, plus ensure it ends up in the format originally intended.

Any clues would be appreciated.

Thanks,

Rob Dexter.
 
Using the DRT I found I can access most of this stuff -

Code:
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.ExportOptions.FormatType = crEFTExcel70
Report.ExportOptions.DiskFileName = "c:\ExportedCR.xls"

But I cannot find the option to use column widths based on Page Header, are they available?

Any clues would be appreciated.

Thanks,

Rob Dexter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top