ggreen86 / XLSX-Workbook-Class

VFP Class to Create an XLSX Workbook without Excel Automation or Installed
45 stars 16 forks source link

When using SetRowHeightRange error when opening new XLSX file in Excel with Sheets.xml #114

Closed rawilliamsjr closed 5 months ago

rawilliamsjr commented 6 months ago

I have attached the created XLSX files the first works fine but just adding the call to SetRowHeightRange triggers an error in Excel. Consolidated Pull Slip_1.xlsx Consolidated Pull Slip_2.xlsx

ggreen86 commented 6 months ago

Rob—

I am not able to duplicate this error – I tried the following code:

Can you provide the example code that duplicates this problem? Thank you.

Greg

From: Rob Williams @.> Sent: Monday, March 4, 2024 4:26 PM To: ggreen86/XLSX-Workbook-Class @.> Cc: Subscribed @.***> Subject: [ggreen86/XLSX-Workbook-Class] When using SetRowHeightRange error when opening new XLSX file in Excel with Sheets.xml (Issue #114)

I have attached the created XLSX files the first works fine but just adding the call to SetRowHeightRange triggers an error in Excel. Consolidated Pull Slip_1.xlsxhttps://github.com/ggreen86/XLSX-Workbook-Class/files/14487341/Consolidated.Pull.Slip_1.xlsx Consolidated Pull Slip_2.xlsxhttps://github.com/ggreen86/XLSX-Workbook-Class/files/14487342/Consolidated.Pull.Slip_2.xlsx

— Reply to this email directly, view it on GitHubhttps://github.com/ggreen86/XLSX-Workbook-Class/issues/114, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGWB33PS43D5LTLKSF47P2DYWTRHPAVCNFSM6AAAAABEF6RVQOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DONZZGE2DEOA. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

rawilliamsjr commented 5 months ago

CPS.zip

The zip contains the code , tables, and the resulting Excel workbook.

ggreen86 commented 5 months ago

Rob--

Thank you for sending the zip file with the source to duplicate the problem. I narrowed the failure to row 844 which is a blank line. When writing the row information, it was not giving a correct range for cell selection on the row (it had 1:0 instead of 1:1). The problem was not the range set for the row height, but rather this error due to no max column being set. I have placed a MAX() command into the statement to ensure that 1 is the minimum value being written.

I have also fixed the methods SetPrintFitToHeight() and SetPrintFitToWidth() to now also set the fittopage setting correctly. However, I have not incorporated your suggestion to have a separate SetPrintTitles() method.

Attached is the updated Release 41 beta 5.

Greg

WorkbookXLSX R41 Beta 5.zip

rawilliamsjr commented 5 months ago

Thank you for all of your efforts. All changes are working in my environment.

ggreen86 commented 5 months ago

Closing issue; corrected in R41.