I'm trying to load an excel sheet into a workbook. It works fine until I edit the sheet, but after I do edit it and try to import it I get"'The left and top of the window bounds must be between -32768 and 32767. Parameter name: value'"
Using version 14.1
System.ArgumentException HResult=0x80070057 Message=The left and top of the window bounds must be between -32768 and 32767.Parameter name: value Source=Infragistics4.Documents.Excel.v14.1 StackTrace: at Infragistics.Documents.Excel.WorkbookWindowOptions.set_BoundsInTwips(Rectangle value) at Infragistics.Documents.Excel.Serialization.Excel2007.XLSX.PartManagers.ObjectModelWorkbookPartManagerBase.LoadWorkbookViewElement(XmlPartManagerBase partManager) at Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.TryLoadNormalElement(QualifiedNameInfo elementName, String strictQualifiedName, Int32 currentChildIndex) at Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.LoadChildElementsHelper(Int32 currentChildIndex, AlternateContentStatus alternateContentStatus) at Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.TryLoadNormalElement(QualifiedNameInfo elementName, String strictQualifiedName, Int32 currentChildIndex) at Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.LoadChildElementsHelper(Int32 currentChildIndex, AlternateContentStatus alternateContentStatus) at Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.TryLoadNormalElement(QualifiedNameInfo elementName, String strictQualifiedName, Int32 currentChildIndex) at Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.LoadChildElementsHelper(Int32 currentChildIndex, AlternateContentStatus alternateContentStatus) at Infragistics.Documents.OfficeOpenXml.Core.PartManagers.XmlPartManagerBase.LoadCore() at Infragistics.Documents.Excel.Serialization.Excel2007.XLSX.PartManagers.ObjectModelWorkbookPartManagerBase.LoadCore() at Infragistics.Documents.OfficeOpenXml.Core.PartManagers.XmlPartManagerBase.Load() at Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.LoadPart(IPackagePart part) at Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.LoadPartRelationships(IPackagePart sourcePart, PartManagerBase sourcePartManagerPrototype, IEnumerable`1 relationships, Boolean hasSourcePartBeenLoaded, Boolean& wereRelationshipsSkipped) at Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.LoadCore() at Infragistics.Documents.Excel.Serialization.Excel2007.XLSX.ObjectModelExcelDocumentManager.LoadCore() at Infragistics.Documents.Excel.Serialization.WorkbookLoadManagerExcel2007.LoadCore() at Infragistics.Documents.Excel.Serialization.WorkbookLoadManager.Load() at Infragistics.Documents.Excel.Workbook.LoadXLSXFile(Workbook workbook, Stream stream, WorkbookLoadOptions loadOptions) at Infragistics.Documents.Excel.Workbook.LoadHelper(Stream stream, String parameterName, WorkbookLoadOptions loadOptions, Boolean isStreamDecrypted, Nullable`1 format) at Infragistics.Documents.Excel.Workbook.LoadHelper(String fileName, WorkbookLoadOptions loadOptions) at Infragistics.Documents.Excel.Workbook.Load(String fileName, WorkbookLoadOptions loadOptions) at Trident.Objects.Business.Stores.StockItemPricingBatch.ImportFromExcel(String filename, ICacheable pricingType) in D:\Code\Trident\Trident.Objects\Trident.Objects\Business\Stores\StockitemPricingBatch.vb:line 699 at Trident.UI.Business.Stores.frmStockItemPricingModule.ImportCommoditiesFromExcel() in D:\Code\Trident\Trident.UI\Trident.UI\Business\Stores\frmStockItemPricingModule.vb:line 191 at Trident.UI.Business.Stores.frmStockItemPricingModule.ImportCommoditiesToolStripMenuItem_Click(Object sender, EventArgs e) in D:\Code\Trident\Trident.UI\Trident.UI\Business\Stores\frmStockItemPricingModule.vb:line 181 at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at Trident.Startup.Main() in D:\Code\Trident\Trident\Startup.vb:line 179
Hello ,
Thank you for contacting . The maximum number of characters in a excel cell is limited to 32,767. If this is exceeded, the renderer displays an error message . If that is not the case then please share your excel file i will try to test it at our end.
test8.xlsx
OK, thanks for looking into this. Here is the file that throws the error.
NOTE. This error is only thrown if I edit the spreadsheet. If I export and then import without editing it the error does not happen.
Create File
If SaveFileDialogXlsx.ShowDialog() = Windows.Forms.DialogResult.OK Then Try Me.Cursor = Windows.Forms.Cursors.WaitCursor ugExcelExporter.Export(grdStockItems, SaveFileDialogXlsx.FileName)
Me.Cursor = Windows.Forms.Cursors.Default If Windows.Forms.MessageBox.Show("Export Complete, Open File?", "Report Export", Windows.Forms.MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then Process.Start(SaveFileDialogXlsx.FileName) End If Catch ex As Exception Me.Cursor = Windows.Forms.Cursors.Default MessageBox.Show("Cannot Create Export File: " & ex.Message.ToString(), "Export", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End If
Import File - Throws error Dim workbook As Infragistics.Documents.Excel.Workbook = Infragistics.Documents.Excel.Workbook.Load(filename)
Hello David,
I looked through the document and you are right UltraSpreadsheet been introduced in V15.2.
But you don’t need to use spreadsheet to show your issue. You can comment it out from my sample and on button click load the excel ,modify it and open it with process.start instead of spreadsheet (like I am doing in my sample) .Modified excel would also save into the bin folder, you can manually open excel from the bin also to test if its throwing error.
If you are still not sure, please provide your isolated sample for me to test it. I am sure grid exported successfully so you can set a sample cover the scenario after that.
Just to know version 14 is longer supported so as I said you can also try to download the latest trial and test the issue at your end first.
With your provided excel I am not able to reproduce the issue running sample against latest supported version 23.1.
I am using the the winforms UltraGridExcelExporter. My version of infragistics doesn't have the UltraWinSpreadsheet that you are using. Is there anything else we can do to troubleshoot this?
Thank you for sharing the code snippet . Looks like you are using excelExporter and exporting the grid to the excel , although I am sure its not the part of the issue . You shared the excel sheet which you exported successfully , so I started my testing with that , I tried loading it to spreadsheet , modified and loaded back again and I don’t see any issue ,but also I tested against latest supported version , so may be issue is with version 14.1 only. Or issue is with editing specific cell , not sure.
Here I attached my test sample , test it against V14.1 would make it clear if the issue is with only older version or not, and if this run fine at your end then feel free to modify the sample reproducing the issue and send it back for further investigation. Also make it clear if you are using aspnet control or winforms control?
WindowsFormsApp1.zip