I am new with VBA macros and customizing reports. Here we have a multi-tab report, has four tabs, and we want to convert it into Excel with multiple tabs. How do I achieve this?
Actually we do have a macro here which converts BO documents to Excel, but this is good only when the report has a single tab. This is what the body of this macro looks like;
What do I have to do to make it convert multitab reports. Any help and suggestion in this direction will be greatly appreciated.
That macro is exporting data providers, not report tabs. The code to save an entire document (all tabs) as Excel is pretty simple, but not very intuitive:
Call ThisDocument.SaveAs("filename.xls")
It’s the use of the .xls extension that triggers the Excel format.
Thanks a lot for the prompt reply. If possible, would you please show me an example of how to use this. I tried your suggestion but was unable to get it as I am a novice to this area especially VBA programming. I would really appreciate your help. Once again thankyou,
With all due respect, I’m not sure I can give you another example. It’s only one line of code after all.
Give us more specific detail on what “was unable to get it” means. What steps did you try? Any specific error message? Unexpected result? While you can learn a lot by reading this forum, it works much better when solving specific problems.
Thanks again for your reply. Actually we are using BO 5.1.3 (can you believe it?)But anyways I was browsing through the forum and actually found this post:
Like you said Save to xls is only supported in V6 and above, I learnt that simply ActiveDocument.SaveAs (“filename.xls”) would not work for our version. There is a macro listed here for download - which it first turns the .rep to .txt and then activates Excel and turns it to .xls or atleast that is what it looks like. For now i am having trouble to run this macro as i am getting compilation errors
Surely my lack of programming skills in VB is not helping. Anyways worst come worst, i will make each tab into seperate reports and use the macro that converts Data Provider values to Excel.