Log in

View Full Version : [SOLVED:] Run Crystal Report from Excel VBA



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.

mancubus
09-12-2014, 02:39 AM
welcome to the forum.

google makes it clear that it really is "Crystal Reports ActiveX Designer Run Time Library", CRAXDRT.dll.

if you don't have CRAXDRT.dll on your computer, download (google) and register it.

WisdomSeeker
09-12-2014, 05:31 PM
Thanks mancubus.

I got my IT guy involved and learned that our Crystal Reports software came with another vendor software we purchase, which may be why the dll wasn't there. He installed an older version of Crystal that we have with another software, and then the correct VBA reference library showed up and I was able to start writing code. However, I was then instructed by my manager not to use Crystal Reports with my application since we may not have Crystal in the future.

So, I will be producing my desired reports in Excel, rendering this thread moot.

Thanks again for your help.

Let me know if there is any standard protocol on this site for marking a thread that is no longer needed.

Aussiebear
09-12-2014, 06:41 PM
I've completed this for you, but for future reference, simply click on the Thread Tools drop down option just above the initial post and go from there.