开发者

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();
....
....
....
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜