So I’m evaluating Aspose.Cells to see if it can take care of a problem introduced as our customers upgrade their computers and move to Adobe 9+ and Office 2010+. The problem being the old methodology of using the COM based Excel libraries to add OLE objects -ex excelSheet.OLEObjects.Add(filename:={name.pdf}, Link:=False, DisplayAsIcon:=False)- no longer works if the newer versions of Adobe are installed.
Using Aspose.Cells easily bypasses the issue of getting a pdf into Excel. However the displays in the sheets are not very helpful to us. In particular we dump a lot of supporting pdf documents onto any given worksheet. So following Aspose’s sample code to insert multiple pdf documents into a sheet:
index = wrkSheet.OleObjects.Add(1, 1, 48, 48, My.Resources.adobe_pdf_document)
wrkSheet.OleObjects.Item(index).ObjectData = fdata
wrkSheet.OleObjects.Item(index).FileFormatType = Aspose.Cells.FileFormatType.Pdf
results in a worksheet filled with 10 or so adobe icons with no differentiation between them or indicator of what maybe in the files. I’ve tried:
wrkSheet.OleObjects.Item(index).DisplayAsIcon = False
thinking it may have been analogous to the Excel library calls with no luck.
If the DisplayAsIcon cannot be made functional, at the very least is there some way to add a name to each of the icons put into a worksheet?
Hi,
Thanks for the suggestion. The problem with the .AddHyperlink({link}) approach I just tried per your suggestion is that the icon is a true hyperlink to the specified {link} location. It would have been an eloquent and acceptable solution to my problem of differentiating the various files’ data by means of the tooltip text, however the pdf files must be embedded.
Differing jpeg images for each file… Not going to happen unless Aspose.Cells also comes with a utility that can dynamically convert a string into a jpeg - aka adding text to the image data byte array for the OLEObjects.Add() method.
I also noticed that in your sample code you included the OleObjects.DisplayAsIcon property. Having tried variations on setting that property (True/False & before/after setting the object data) I find discernible affect on what that property does.
Your reply is appreciated though.
Hi,
My program is a ‘Work-In-Progress’, so the copies of the same embedded pdf are actually all supposed to be different files and first two worksheets should be copied several more times - but attached is something like CiSCO would like see. The pdf data opened in the worksheets when the workbook is opened. As is, I have to manually “open” each of the pdf objects and then save the spreadsheet.
Hi,
Not as hands free as the actual embedding of the pdf files, but an acceptable work around.
Thanks for the support. I have put in the recommendation that licensing for Aspose.Cells be the solution to our current predicament.
Hi,