Free Support Forum - aspose.com

Aspose.cells.pictures[index].addhyperlink

i'm having trouble adding hyperlinks to images or shapes in excel.

when i look at the base properties at run-time it says addinghyperlinks is locked.

how can i get passed this and add my hyperlink to images or shapes. i don't have any trouble putting links directly in a cell.


This message was posted using Aspose.Live 2 Forum

Hi,

Thanks for considering Aspose.

Currently, adding hyperlinks for pictures are not supported. We will support it soon for you need.

Thank you.

Hi,

Please try the attached version (4.4.1.10).

Thank you.

Amjad Sahi:

Hi,

Please try the attached version (4.4.1.10).

Thank you.

Works great. Thanks. on a side note aspose.cells.pictures[index].Name does not contain a value. I would rather not use the Excel Interop at all and just use aspose if the Name property actually returned something.

Hi,

Picture.Name will work fine for MS Excel (97 - 2003). For MS Excel 2007 .xlsx files, we will support this feature soon.

Thank you.

Using MS Excel 2003.

Here is the code:

private void getExcelBookmarks(ref ComboBox cbo, ref Aspose.Cells.Pictures pics)

{

cbo.Items.Clear();

for (int i = 0; i < pics.Count; ++i)

{

cbo.Items.Add(pics[i].Name + i.ToString());

}

}

The result is the combo box is only filled with the integer from the counter the name property from the Pictures collection is not returning a value.

Hi,

Could you post your sample file ? We will check it soon.

Here is the file. pretty basic, just two clip art images.

You provided me a way to add the hyperlink to the picture and it works great. But the screenTip (tooltip) that comes up when you hover over the image is the excel document not the Hyperlink Address.

When I try to set this property with the code below:

excelsheet.Pictures[this.cboDestBookmarks.SelectedIndex].Hyperlink.ScreenTip = strAddress;

I get an exception error.

on a side note with the picture name property from the Pictures collection:

To display the picture names in the combo box, I use the Excel Interop directly to get these values as I have no way to do it using Aspose.Cells.

Hi,

Thanks for the template file.

We found the issue related retrieving picture name and setting tooltip, We will fix it soon.

Thank you.

Thanks!

Also can you makes sure the Shapes collection also has the ability to add hyperlinks. As I'm working with both Shapes and Pictures.

Hi,

Please try the attached version (4.4.1.11). It will fix all the issues you face.

Additional Notes:
You may add hyperlink not only for images but also for any type of shapes. We have supported to load the hyperlink of the shape from the designer file as well. We have also supported to set the ScreenTip for the hyperlinks of images and shapes. Moreover, we have fixed the bug of getting the name of the shapes or pictures.
Sample code:
Workbook workbook = new Workbook();
workbook.Open("d:\\test\\Book1.xls");
Worksheet worksheet = workbook.Worksheets["Sheet1"];
Aspose.Cells.Picture pic = worksheet.Pictures[1];
MessageBox.Show(pic.Name);
pic.AddHyperlink("http://www.aspose.com");
pic.Hyperlink.ScreenTip = "This is my pic";

workbook.Save("d:\\test\\outBookPic.xls");
Thank you.