![]() |
Exporting Crystal Reports
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? -- Richard Champlin Administrative Program Assistant II Children''''''''s Hospital & Regional Medical Center, Seattle |
Exporting Crystal Reports
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 Champlin wrote: 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? -- Richard Champlin Administrative Program Assistant II Children''''''''s Hospital & Regional Medical Center, Seattle -- Dave Peterson |
Exporting Crystal Reports
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" wrote: 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 Champlin wrote: 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? -- Richard Champlin Administrative Program Assistant II Children''''''''s Hospital & Regional Medical Center, Seattle -- Dave Peterson |
All times are GMT +1. The time now is 07:40 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com