Embedding a PDF file in Excel .xls using C#
Anyone have any 开发者_如何学JAVAtips for how to embed PDF files in a .xls Excel spreadsheet using C#?
For those that need the answer, here it is....
Application xlApp = new Application();
xlApp.DisplayAlerts = false;
Workbook book = xlApp.Workbooks.Open(@"C:\test5.xls", 2, false);
Worksheet sheet = book.Worksheets[1];
sheet.Shapes.AddOLEObject(Filename: @"C:\test.pdf", Height: 400, Width: 400);
book.Save();
....
....
....
精彩评论