Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it still true that the AutoCAD NET API does not give access to embedded Excel worksheets?
I've looked and looked and there is some complicated MFC stuff for a linked Excel file but I can find no real help for embedded Excel files.
In code I've got as far as this:
foreach (ObjectId id in btr) { if (id.ObjectClass.Name == "AcDbOle2Frame") try { Ole2Frame oleFrame = tr.GetObject(id, OpenMode.ForRead) as Ole2Frame; //object excel = oleFrame.OleObject; // Excel.Workbook EmbeddedExcel = (Excel.Workbook)oleFrame.OleObject.GetType(); Type eType = oleFrame.OleObject.GetType(); string sMsg = "found OLE object = " + eType.ToString() ; LogWriter.LogWrite(sMsg); } catch (System.Exception e) { string sMsg = string.Format("Exception ExcelChanger: {0}", e.Message); System.Windows.Forms.MessageBox.Show(sMsg); LogWriter.LogWrite(sMsg); } }
...but any attempt to do anything useful results in a COM HRESULT error.
Solved! Go to Solution.