Hi
I do see some samples that says we can use Infragistics.Excel to work with MS Excel objects.
My requirement is that after exporting the Grid to Excel (excel1.xls), I want to read excel2.xls and paste few content on excel1.xls. Below is the code that I used with MS Excel Object Lib 11.0 But for some reason, I get automation error on the server (it runs just fine on my development machine). So, thought of using Infragistics.Excel for this simple purpose. Would you please help to get Infragistics.Excel equivalent?
oBOMDataWB = oXL.Workbooks.Open(strDataXLPath) 'grid exported data
oXLTemplateWB = oXL.Workbooks.Open(strTemplatePath) 'Template that has logo image and format.
oBOMDataWB.Sheets(1).Paste()
'Hide the header data rows
oRange.EntireRow.Hidden = True
oBOMDataWB.Save()
oBOMDataWB.Close()
To use code like this, you need to have Excel installed on your server. If you do not, you can try to use the Infragistics.Excel assembly, but some of the things you are doing above would need to be done manually. The WorksheetRow object does not support copying and pasting, so you would need to manually transfer values and formatting to individual cells in the row. In addition, the Infragistics.Excel assembly does not support opening template files, so it might not even be possible to accomplish this with the current features of the assembly. The WorksheetRow does have a Hidden property which you could set to True.