From 63a424f372d513fd644e1717d02447b092145658 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 7 Feb 2020 10:39:30 -0500 Subject: [PATCH] Improve reporting of error states Distinguish between "the definition of the header row(s) is bad" and "the current Selection is invalid" error states in the reporting into the status box on the form. --- src/UFExporter.frm | 18 ++++++++++++++++-- src/UFExporter.frx | Bin 4632 -> 4632 bytes 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/UFExporter.frm b/src/UFExporter.frm index 8d5b29e..fc37162 100644 --- a/src/UFExporter.frm +++ b/src/UFExporter.frm @@ -43,6 +43,7 @@ Attribute appn.VB_VarHelpID = -1 Const NoFolderStr As String = "" Const InvalidSelStr As String = "" Const NoHeaderRngStr As String = "" +Const BadHeaderDefStr As String = "" ' ===== GLOBALS ===== @@ -444,15 +445,28 @@ Private Function getHeaderRangeAddress() As String Dim headerRange As Range + ' Store the return value from retrieving the header range Set headerRange = getHeaderRange If ChBxHeaderRows.Value Then - If Not headerRange Is Nothing And checkHeaderRowValues Then + ' Header range has to be defined in order for there to be + ' an address to return. The validity of the header row + ' definition in the userform is already checked + ' within getHeaderRange, and so it doesn't need(?) to be + ' checked again here. + If Not headerRange Is Nothing Then getHeaderRangeAddress = getHeaderRange.Address( _ RowAbsolute:=False, ColumnAbsolute:=False _ ) Else - getHeaderRangeAddress = InvalidSelStr + ' Though, it's clearer to change the error message in the display box + ' depending on whether the header definition is invalid, + ' or if the actual range selection on ActiveSheet is bad + If Not checkHeaderRowValues Then + getHeaderRangeAddress = BadHeaderDefStr + Else + getHeaderRangeAddress = InvalidSelStr + End If End If Else getHeaderRangeAddress = NoHeaderRngStr diff --git a/src/UFExporter.frx b/src/UFExporter.frx index 1f0b7bf47e60d13237afcc5eb47aa3f9b9a11d21..fe2f963e716b750d6cb40c6327b77b7421bc7c34 100644 GIT binary patch delta 401 zcmXw!y-UMT6vb~|V>K^L(pn0l#@4oC7Xw!DBTE!f9Gn!2r63gZNDKL>t%6$xQFN;G zF2${rYr%g&-2}luz(GfM7bo#Wa5`|#?;g(W<$L+Tg(yDV-M-vki?W!i`pzbhF(?p# zD8Sj~X(MRjygZZqcK&<-7~=kh8?;#Ha}GzOC7hC}I?RKuz_nS^bh09vw1`(yHqB4S zBow$vAy9XjU-g&?EqLZtt2iy`#B}geDu!i~be!~cT%jfM?cfbHL-U0iv=*#48qBvX zr%NXU2Q%_=j&I8RHLL$yj}^MhpI~NRKjM4dBlsifobJiSkje2ie5E>m%HAk**>>Hw znV;DR+!N1lS!mHTUd9Tf7T_S(MOBI7M{FJ!#WePmGU)(*DRU7HV@|CI4BKis;xUGA z>Z|}5(Mp6z6>UM#v7;RdJNTs;!~)F44Z>X9;}Upy&V^Uq#}7s<5R(Ay6h0;_+)q6G E0_D?eAOHXW delta 420 zcmYL^&q@MO6vofYoyt4@#{v;Wy9$YvkWtiZEW~JCAc+u24kkD=rU~N4AX~Ia>1?DI z2%^P+FHp-O=m84ay0-`DUKh3canJYN?|f&J7$xj$Md?dFZ{r)qsRWG_%Yz(*qzo_* zaGCEktmcJH@X5gzZ8DPpV2(?khgV{?`|{zHikldQ&4z0eFz`mWE}G zV25U+!WV`l&!NIstLtXj&^7*k<-t3+Od}$4LNnq=SPjWthTCdE42P;FhVN>c+GMZM z(9KE~2Q-Szxf$oVv01L?uew`3ESptb>#}oR>YMN$F}!!K@m^6H^UJJUv4KyL|O{8>EqKmP)< Cs%*pn