C# Export Excel Chart as object (not as picture) to Word
问题 I want to export an excel chart to Word as an object (Excel Chart), not as a picture. As picture is very easy with Chart.CopyPicture I´m using AddOleObject, but it gives an error about not being able to link the file. This is the code: Document doc; // Existing document string chartSheet = xlsFilePath + "!" + chartSheetName; string type = "Excel.Chart.8"; InlineShape shape = doc.Content.InlineShapes.AddOLEObject(ClassType: type, FileName: chartSheet, LinkToFile: false, DisplayAsIcon: false);