Exporting Crystal Reports

R

Richard Champlin

I often export crystal reports into Excel to manipulate/format the data. I
use macros to format the report to make it quicker. I find, though, with
this one particular macro, that I have to go in and change the index number
of the Crystal Report Viewer (CrystalReportViewer[1].xls, ....[2].xls, etc).
How can I make the macro run without having to change the number every time?
 
D

Dave Peterson

Excel doesn't like those [] in the filename.

Is this built into CR (a bad choice!) or is this a filename that you're creating
(a bad choice that can be fixed easily by you???).

When I have a generic macro that does this kind of thing, I'll write it so that
it works against the activesheet (or activeworkbook). I won't use the sheet
name/workbook name at all.

If this doesn't help, you may want to post part of the code that causes the
trouble.

Richard said:
I often export crystal reports into Excel to manipulate/format the data. I
use macros to format the report to make it quicker. I find, though, with
this one particular macro, that I have to go in and change the index number
of the Crystal Report Viewer (CrystalReportViewer[1].xls, ....[2].xls, etc).
How can I make the macro run without having to change the number every time?
 
R

Richard Champlin

Here's some of the code:
(it looks to me like the brackets are built into the filename when I export
the Crystal Report)

Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
ChDir "O:\At Zero Reports\Excel & Text Files\2008"
Workbooks.Open Filename:= _
"O:\At Zero Reports\Excel & Text Files\2008\At Zero.xlt",
Editable:=True
Range("A9").Select
Windows("CrystalReportViewer[1].xls").Activate
Rows("1:47").Select
Selection.Copy
Windows("At Zero.xlt").Activate
ActiveSheet.Paste
--
Richard Champlin
Administrative Program Assistant II
Children''''''''s Hospital & Regional Medical Center, Seattle


Dave Peterson said:
Excel doesn't like those [] in the filename.

Is this built into CR (a bad choice!) or is this a filename that you're creating
(a bad choice that can be fixed easily by you???).

When I have a generic macro that does this kind of thing, I'll write it so that
it works against the activesheet (or activeworkbook). I won't use the sheet
name/workbook name at all.

If this doesn't help, you may want to post part of the code that causes the
trouble.

Richard said:
I often export crystal reports into Excel to manipulate/format the data. I
use macros to format the report to make it quicker. I find, though, with
this one particular macro, that I have to go in and change the index number
of the Crystal Report Viewer (CrystalReportViewer[1].xls, ....[2].xls, etc).
How can I make the macro run without having to change the number every time?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top