ASP.NET - Export to excel data using Excel Interop with Ole Object embed(Word) -cannot insert object

Asked By Balaji MR on 23-Aug-13 07:44 AM
i want to export grid data to excel along with some ref. documents (word) embedded as OLE Object in the excel for each row.
i can able to export data to excel using Excel Interop but when i try to embedded using following code, i am getting COM object error "Cannot Insert Object."

excelSheets.Shapes.AddOLEObject(o, tFileName, o, true, @"C:\\Word.ico","0", System.IO.Path.GetFileName(tFileName), _ObjExcelRange.Left, _ObjExcelRange.Top, _ObjExcelRange.Width, _ObjExcelRange.Height);

i am facing following error....

System.Runtime.InteropServices.COMException (0x800A03EC): Cannot insert object.

at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at

Microsoft.Office.Interop.Excel.Shapes.AddOLEObject(Object ClassType, Object Filename, Object Link, Object DisplayAsIcon, Object IconFileName, Object IconIndex, Object IconLabel, Object Left, Object Top, Object Width, Object Height)

Please suggest a way to embedded...

Thanks & Regards,