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

vba export data only to excel

Status
Not open for further replies.

Eprice

Technical User
May 6, 2003
209
US
Hello
I am trying to export crystal reports data to excel but there are probably at least 20 extra columns when I use my code to run the export. When I manually export to excel using the format 'MS Excel 97-2000 (Data Only)' it works perfect. I don't know the correct way to code the data only part. This is what I have.

Dim CrApp As Object
Set CrApp = New Craxdrt.Application
Dim CrRep As Craxdrt.Report
Set CrRep = CrApp.OpenReport("N:\Job Log\AC-JOBLOG PRINTED.rpt")
With CrRep.ExportOptions
.DestinationType = crEDTDiskFile
.FormatType = crEFTExcel80
.DiskFileName = "N:\Job Log\AC-JOBLOG PRINTED REPORTS.xls"
End With
CrRep.Export (False)
Set CrRep = Nothing
Set CrApp = Nothing

Does anybody know what I should put in .FormatType to get data only so it exports correctly. Thanks
Lisa

 
I think the format type is crEFTExcel80Tabular

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Not getting an answer, I started with the list index number and found tha 6 did what I wnated with FormatType = 6.
Thanks
Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top