hopefully you guys can help me here. I have this excel interop picture code that seems to be only working on my end. The picture is in a folder in the mapped network drive. When I run the code and receive the excel file, the picture is on the file.
Microsoft.Office.Interop.Excel.Range picRange = xlWorkSheet.get_Range("A1:G1");
picRange.Merge(Type.Missing);
Microsoft.Office.Interop.Excel.Pictures p = xlWorkSheet.Pictures(misValue) as Microsoft.Office.Interop.Excel.Pictures;
Microsoft.Office.Interop.Excel.Picture pic = null;
pic = p.Insert(Server.MapPath("~/images/letter.gif"), misValue);
pic.Left = 87;
pic.Top = Convert.ToDouble(picRange.Top);
pic.Height = 80.25;
pic.Width = 320;
pic.Placement = Microsoft.Office.Interop.Excel.XlPlacement.xlFreeFloating;
However, if I run the code on a different computer, which also has access to that mapped network drive, it the excel file comes with an error on the image that says:
the linked image cannot be displayed. The file may have been moved renamed or deleted
I've checked three times and made sure that the image file is the right name and the right place. But it only seems to work locally on my computer.
Is there a function in the excel interop library where I can create an instance of the image instead of linking to the image file? Any help will do.