Skip to content

Commit f075044

Browse files
tduguidtduguid
authored andcommitted
Updated applying the quotes to time as well as dates
1 parent 4cb76e7 commit f075044

File tree

2 files changed

+33
-24
lines changed

2 files changed

+33
-24
lines changed

CS/Scripts/Ribbon.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,15 +1115,24 @@ public void OpenGraphData()
11151115
/// <remarks></remarks>
11161116
public static string ApplyTextQuotes(Excel.ListColumn col)
11171117
{
1118+
Excel.Range cell = FirstNotNullCellInColumn(col.DataBodyRange);
1119+
string timeFormat = "h:mm:ss AM/PM"; //TODO: reference a list of time formats
11181120
try
11191121
{
1120-
if ((GetSqlDataType(col) != Properties.Settings.Default.Column_TypeNumeric))
1122+
if ((GetSqlDataType(col) != Properties.Settings.Default.Column_TypeNumeric)) //or date/time
11211123
{
11221124
return Properties.Settings.Default.Table_ColumnScriptQuote;
11231125
}
11241126
else
11251127
{
1126-
return string.Empty;
1128+
if (cell.NumberFormat.ToString() == timeFormat)
1129+
{
1130+
return Properties.Settings.Default.Table_ColumnScriptQuote;
1131+
}
1132+
else
1133+
{
1134+
return string.Empty;
1135+
}
11271136
}
11281137
}
11291138
catch (Exception ex)

VBA/Install.bat

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
@ECHO OFF
2-
3-
REM
4-
REM |--------------------------------------------------------------------------------------------------------------------
5-
REM | Purpose: Generic Install
6-
REM |
7-
REM | Ver. Date Author Details
8-
REM | 1.00 27-NOV-2017 Anthony Duguid Initial version.
9-
REM |--------------------------------------------------------------------------------------------------------------------*/
10-
11-
12-
REM
13-
REM /E = Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.
14-
REM /D:m-d-y = Copies files changed on or after the specified date.
15-
REM If no date is given, copies only those files whose source time is newer than the destination time.
16-
REM /K = Copies attributes. Normal Xcopy will reset read-only attributes.
17-
REM /Q = Does not display file names while copying.
18-
REM /R = Overwrites read-only files.
19-
REM /Y = Suppresses prompting to confirm you want to overwrite an existing destination file.
20-
REM
21-
22-
REM Copy the install directory and sub-directories
1+
@ECHO OFF
2+
3+
REM
4+
REM |--------------------------------------------------------------------------------------------------------------------
5+
REM | Purpose: Generic Install
6+
REM |
7+
REM | Ver. Date Author Details
8+
REM | 1.00 27-NOV-2017 Anthony Duguid Initial version.
9+
REM |--------------------------------------------------------------------------------------------------------------------*/
10+
11+
12+
REM
13+
REM /E = Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.
14+
REM /D:m-d-y = Copies files changed on or after the specified date.
15+
REM If no date is given, copies only those files whose source time is newer than the destination time.
16+
REM /K = Copies attributes. Normal Xcopy will reset read-only attributes.
17+
REM /Q = Does not display file names while copying.
18+
REM /R = Overwrites read-only files.
19+
REM /Y = Suppresses prompting to confirm you want to overwrite an existing destination file.
20+
REM
21+
22+
REM Copy the install directory and sub-directories
2323
XCOPY ".\ScriptHelp.xlam" "%AppData%\Microsoft\AddIns\ScriptHelp.xlam" /E /K /Q /R /Y /D

0 commit comments

Comments
 (0)