WisdomSeeker
09-11-2014, 07:28 PM
Hello all,
I have been programming in Excel VBA for about 3-1/2 years, and this is my first time posting.
My goal is to use Excel VBA to run a Crystal Report. My data source is an Excel file. I am able to run my report by manually opening the Crystal Reports program, linking to my Excel data and either previewing or printing the report output. Now I need to do the same thing using Excel VBA code. My data source will always be Excel but the specific file being used will vary each time my application is used.
I've searched the internet and found various answers, but the general consensus is that I need to activate the reference library Crystal Reports [version] ActiveX Designer Run Time Library, or something close to that. My problem is that I do not have such a reference showing up in my list of available VBA references.
I'm running Windows 7, Office 2010, and here is my Crystal Reports version info:
Crystal Reports 2008
CR Developer
Version 12.5.6.1850
Product Type: Full
In my VBA list of available references, I have 6 that start with BusinessObjects, a bunch that start with Crystal or Crystal Enterprise, and I have 13 that start with Crystal Reports:
Common Object Model Library 12.0
Controllers Library 12.0
Data Definition Model Library 12.0
HTML Report Renderer 12.0
Object Factory Library 12.0
Page Object Model Type Library 12.0
Print Control Type Library 12.0
Prompts EMF Library 12.0
Report Definition Model Library 12.0
Report Source Bridge Library 12.0
SAX Serialize Type Library 12.0
SmartTag Library 12.0
Template Engine Type Library 12.0
But none that say "ActiveX" or "Runtime".
So, 2 questions:
1) Which reference(s) should I activate? Or if I need one that I don't have showing, how do I get it in there?
2) What is some sample code that will get my report to run? Let's say my data source is called "data.xls", and my report is called "Report.rpt", and all my tables & fields have already been set up in the report.
Thanks very much.
I have been programming in Excel VBA for about 3-1/2 years, and this is my first time posting.
My goal is to use Excel VBA to run a Crystal Report. My data source is an Excel file. I am able to run my report by manually opening the Crystal Reports program, linking to my Excel data and either previewing or printing the report output. Now I need to do the same thing using Excel VBA code. My data source will always be Excel but the specific file being used will vary each time my application is used.
I've searched the internet and found various answers, but the general consensus is that I need to activate the reference library Crystal Reports [version] ActiveX Designer Run Time Library, or something close to that. My problem is that I do not have such a reference showing up in my list of available VBA references.
I'm running Windows 7, Office 2010, and here is my Crystal Reports version info:
Crystal Reports 2008
CR Developer
Version 12.5.6.1850
Product Type: Full
In my VBA list of available references, I have 6 that start with BusinessObjects, a bunch that start with Crystal or Crystal Enterprise, and I have 13 that start with Crystal Reports:
Common Object Model Library 12.0
Controllers Library 12.0
Data Definition Model Library 12.0
HTML Report Renderer 12.0
Object Factory Library 12.0
Page Object Model Type Library 12.0
Print Control Type Library 12.0
Prompts EMF Library 12.0
Report Definition Model Library 12.0
Report Source Bridge Library 12.0
SAX Serialize Type Library 12.0
SmartTag Library 12.0
Template Engine Type Library 12.0
But none that say "ActiveX" or "Runtime".
So, 2 questions:
1) Which reference(s) should I activate? Or if I need one that I don't have showing, how do I get it in there?
2) What is some sample code that will get my report to run? Let's say my data source is called "data.xls", and my report is called "Report.rpt", and all my tables & fields have already been set up in the report.
Thanks very much.