I am using BO 5.1.8; I need to save a table to Excel; Export won’t work because I am using multiple data providers. Is there any way to copy and paste into Excel? I tried selecting the entire table then copy and paste into Excel; it didn’t work. Any ideas or confirmation that it is not doable would be great.
Yes, that’s a good way. Please remember to Search first, as you’d see from Asking Smart BOB Questions, a hyperlink available every time you start a new topic – and to check “sticky topic” FAQs at the top of each forum.
There is an other workaround to saving a report to Excel.
Save the report as a html file. This will create a folder with a subfolder containing a html file. This file is the table of the report and can be opend with Excel. Just save the file as xls in Excel and done. There might be a little shifting of cells depending on your reports layout.
I even think you could write a macro for it.
folder name = report name (without the .rep)
subfolder name = sheet name in report(I think with spaces replaced by _ )
html filename = sheet name in report (again with spaces replaced by _ )
All this can be found using a macro, even opening Excel and saving the file again.
Surely some wizz can figure it out
–edit–
Ok, ok, I’m a freak
Just put this little sub together for exporting to Excel
–edit again –
Added a couple of more line so all reports in the document will be exported
(Oh, and don’t forget to add a refrence to the Excel library for the Excel objects)
Option Explicit
Sub Export2Excel()
Dim strFileName As String
Dim strSheetName As String
Dim objReports As Reports
Dim objReport As Report
Dim strPath
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
strFileName = ActiveDocument.Name
strPath = ActiveDocument.Path & "\"
Set objReports = ActiveDocument.Reports
For Each objReport In objReports
strSheetName = objReport.Name
ActiveReport.ExportAsHtml (strPath & strSheetName)
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(strPath & strSheetName & ".htm")
xlBook.SaveAs strPath & strSheetName & ".xls", FileFormat:=xlNormal, ConflictResolution:=xlUserResolution
xlApp.Quit
Kill strPath & strSheetName & ".htm"
Next
MsgBox "Export Done. ;-)"
Set objReports = Nothing
Set objReport = Nothing
Set xlApp = Nothing
Set xlBook = Nothing
End Sub