Thanks for your posting and using Aspose.Cells for GridWeb.
We were able to observe this exception that occurs while saving the Excel file which contains picture in GridWeb.
We have tested this issue with the following code using the latest version: Aspose.Cells for GridWeb v184.108.40.2060.
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
CELLSNET-42879 - Exception on saving Excel with picture in GridWeb.
Please note, you should add acw_client
directory inside your virtual directory
in some folder. Suppose you add it in a directory named grid
, then you should add the following app settings in your web.config
file. These are needed so that GridWeb could work fine.
<add key=“aspose.cells.gridweb.acw_client_path” value=“grid/acw_client”/> C#
string filePath = @“F:\Shak-Data-RW\Downloads\Book1.xlsx”;
GridWeb1.WebWorksheets.SaveToExcelFile(filePath + “.out.xlsx”);
[InvalidCastException: Unable to cast object of type 'Aspose.Cells.GridWeb.Data.Picture' to type 'System.Collections.SortedList'.]
..(Object , WebWorksheets , Boolean , ) +5341
Aspose.Cells.GridWeb.Data.WebWorksheets.SaveToExcelFile(String targetFile) +137
TestGridWeb.Page_Load(Object sender, EventArgs e) in f:\Shak-Data-RW\Projects\AsposeProject\AsposeGridWeb\TestGridWeb.aspx.cs:32
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627