Shape.Hyperlink becomes protected in Office 12

Hi all,

I'm doing an add-in using VS.NET 2005 for Office 12. I'm adding an image with a hyperlink and I then try to access the hyperlink using shape.Hyperlink. When I try this I get the following error message Attempted to read or write protected memory. This is often an indication that other memory is corrupt”.

Can anyone help me on this
Pls let me know where to post this query if this is not the right forum :-)

TIA
Pavan



Answer this question

Shape.Hyperlink becomes protected in Office 12

  • TheHardewareGeek

    Hi Pavan,

    Are you having problems when you're attempting to associate the hyperlink with the shape Or after you've already associated the hyperlink with the shape

    For example this method successfully adds a hyperlink to a shape in Excel 12 (Excel = Microsoft.Office.Interop.Excel):

    private void AssignHyperlink(Excel.Worksheet ws, Excel.Shape shape, string URL)
            {
                ws.Hyperlinks.Add(shape, URL, missing, missing, missing);
            }

    What is the target application for your add-in

    Thanks,

    Steve



  • Frans Bouma - C# MVP

    the issue crops up when I say shape.Hyperlink

    like Hyperlink abc = shape.Hyperlink


  • Shape.Hyperlink becomes protected in Office 12