Skip to content

Commit 91b25a9

Browse files
committed
Merge branch 'main' into stable
2 parents 703f676 + 3c33a6f commit 91b25a9

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88

9+
### [1.2.2] - 2022-03-10
10+
11+
#### Fixed
12+
13+
- Fixed #36, truncation of cell contents to 255 characters by `Format`,
14+
by skipping the call to `Format(...)` when `Len(cel.Value)` is greater
15+
than 250. (Content lengths this long ***should*** only occur when the
16+
cell contains free text for which `Format()` is a no-op anyways.)
17+
18+
919
### [1.2.1] - 2021-07-28
1020

1121
#### Internal

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-2021 Brian Skinn
3+
Copyright (c) 2016-2022 Brian Skinn
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ See the project [wiki](https://github.com/bskinn/excel-csvexporter/wiki) for doc
66

77
The binary `.xlam` file for each release can be found on the GitHub page for that release.
88

9-
Copyright (c) Brian Skinn 2016-2021
9+
Copyright (c) Brian Skinn 2016-2022
1010

1111
License: The MIT License
1212
See [`LICENSE.txt`](https://github.com/bskinn/excel-csvexporter/blob/main/LICENSE.txt) for full license terms.

src/Exporter.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Attribute VB_Name = "Exporter"
77
' # bskinn@alum.mit.edu
88
' #
99
' # Created: 24 Jan 2016
10-
' # Copyright: (c) Brian Skinn 2016-2021
10+
' # Copyright: (c) Brian Skinn 2016-2022
1111
' # License: The MIT License; see "LICENSE.txt" for full license terms.
1212
' #
1313
' # http://www.github.com/bskinn/excel-csvexporter

src/UFExporter.frm

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Attribute VB_Exposed = False
2222
' # bskinn@alum.mit.edu
2323
' #
2424
' # Created: 24 Jan 2016
25-
' # Copyright: (c) Brian Skinn 2016-2021
25+
' # Copyright: (c) Brian Skinn 2016-2022
2626
' # License: The MIT License; see "LICENSE.txt" for full license terms.
2727
' #
2828
' # http://www.github.com/bskinn/excel-csvexporter
@@ -583,7 +583,7 @@ Private Sub writeCSV(dataRg As Range, tStrm As TextStream, nFormat As String, _
583583

584584
Dim cel As Range
585585
Dim idxRow As Long, idxCol As Long
586-
Dim workStr As String
586+
Dim workStr As String, outText As String
587587
Dim errNum As Long
588588

589589

@@ -600,6 +600,12 @@ Private Sub writeCSV(dataRg As Range, tStrm As TextStream, nFormat As String, _
600600
If ChBxHiddenCols.Value Or _
601601
Not dataRg.Cells(idxRow, idxCol).EntireColumn.Hidden Then
602602
Set cel = dataRg.Cells(idxRow, idxCol)
603+
If Len(CStr(cel)) > 250 Then
604+
' This *HAS* to be free text..... right??
605+
outText = cel.Value
606+
Else
607+
outText = Format(cel.Value, nFormat)
608+
End If
603609

604610
' Output value to CSV with surrounding quotes if indicated
605611
If ( _
@@ -609,9 +615,9 @@ Private Sub writeCSV(dataRg As Range, tStrm As TextStream, nFormat As String, _
609615
) _
610616
) Then
611617
workStr = workStr & TxBxQuoteChar.Value & _
612-
Format(cel.Value, nFormat) & TxBxQuoteChar.Value
618+
outText & TxBxQuoteChar.Value
613619
Else
614-
workStr = workStr & Format(dataRg.Cells(idxRow, idxCol).Value, nFormat)
620+
workStr = workStr & outText
615621
End If
616622

617623
workStr = workStr & Separator

src/UFExporter.frx

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)