Found the ANSWER! :)
I would have never taught to try the Biff8 object. Infragistics! renaming this might help.
Dim objExcWSTCBalances As Infragistics.Excel.Worksheet
Dim objExcWSTCPayments As Infragistics.Excel.Worksheet
objExcWSTCInvoices = objExcelWB.Worksheets.Add("TC On Demand Invoices")
uwgExcelExporter.Export(uwGridRptResults, objExcWSTCBalances, 0, 0)
uwgExcelExporter.Export(uwGridRptResultsTP2, objExcWSTCInvoices, 0, 0)
uwgExcelExporter.Export(uwGridRptResultsTP3, objExcWSTCPayments, 0, 0)
BIFF8Writer.WriteWorkbookToFile(objExcelWB, strSaveFileAs)
objExcWSTCPayments = Nothing
objExcWSTCInvoices = Nothing
objExcWSTCBalances = Nothing
objExcelWB = Nothing
This is the code I have so far;
Imports Microsoft.Office.Interop 'Excel multi-tab exporting
This runs without error. But how do I save it to say, "C:\Rpt_TCOnDemand_RunBy_Yoda.xls"
This is frustrating! :(
thank you very much for this. I had gotten close to this. But my question is how does this save out to the PC?
For instance when exporting a single grid I use the following;
strSaveFileAs = "C:\Rpt_Orders_RunBy_Yoda.xls"
uwgExcelExporter.Export(uwGridRptResults, strSaveFileAs)
This works fine to create the xcel doc on the C: drive.
In your code I don't see an area to put this, strSaveFileAs , parameter?
Thanks
Deasun.
I have done what you have described. I used 3 separate grids on a tab control. The grid itself does not have a tab funtion to it.
When exporting you would just pick the worksheet in the workbook you are exporting to. Something like this:
Dim objExcelWorkBook As Workbook = New Workbook
objExcelWorkBook.add("Worksheet1")
objExcelWorkBook.add("Worksheet2")
objExcelWorkBook.add("Worksheet3")
UltraGridExcelExporter.Export(ultragrid2, objExcelWorkBook.Worksheets("Worksheet2"), 0, 0)
UltraGridExcelExporter.Export(ultragrid3, objExcelWorkBook.Worksheets("Worksheet3"), 0, 0)
I hope this helps
Anyone?