Skip to content

Commit c0799b9

Browse files
committed
Support Xlsm AutoCheck #227
1 parent c7e4230 commit c0799b9

File tree

11 files changed

+83
-16
lines changed

11 files changed

+83
-16
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ No, the image test has 1 million rows*10 columns of data, the maximum memory usa
886886
### Limitations and caveats
887887

888888
- Not support xls and encrypted file now
889+
- xlsm only support Query
889890

890891
### Reference
891892

README.zh-CN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ A. 名称一样,系统会自动映射(注意:大小写不敏感)
881881

882882
### 局限与警告
883883

884-
- 目前不支援 xls (97-2003) 或是加密文件。
884+
- 目前不支援 xls (97-2003) 或是加密文件
885+
- xlsm 只支持查询
885886

886887

887888

README.zh-Hant.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,8 @@ A. 名稱一樣,系統會自動映射(注意:大小寫不敏感)
874874

875875
### 侷限與警告
876876

877-
- 目前不支援 xls (97-2003) 或是加密檔案。
877+
- 目前不支援 xls (97-2003) 或是加密檔案
878+
- xlsm 只支持查詢
878879

879880

880881

docs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
---
88

9+
### 0.14.3
10+
- [Opt] Support Xlsm AutoCheck #227
11+
- [Bug] Fix SaveAsByTemplate single column demension index error #226
12+
913
### 0.14.2
1014
- [Bug] Fix asp.net webform gridview datasource can't use QueryAsDataTable #223
1115

docs/README.zh-CN.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
---
99

10+
11+
### 0.14.3
12+
- [Opt] 支持 Xlsm 自动判断 #227
13+
- [Bug] 修正 SaveAsByTemplate 单列 demension 索引错误 #226
14+
1015
### 0.14.2
1116
- [Bug] 修正 asp.net webform gridview datasource 不能使用 QueryAsDataTable #223
1217

docs/README.zh-Hant.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
---
99

10+
### 0.14.3
11+
- [Opt] 支持 Xlsm 自動判斷 #227
12+
- [Bug] 修正 SaveAsByTemplate 單列 demension 索引錯誤 #226
13+
1014
### 0.14.2
1115
- [Bug] 修正 asp.net webform gridview datasource 不能使用 QueryAsDataTable #223
1216

samples/xlsx/TestIssue227.xlsm

19 KB
Binary file not shown.

src/MiniExcel/MiniExcel.TypeCheker.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ internal static ExcelType GetExcelType(string filePath, ExcelType excelType)
1414
case ".csv":
1515
return ExcelType.CSV;
1616
case ".xlsx":
17+
case ".xlsm":
1718
return ExcelType.XLSX;
1819
//case ".xls":
1920
// return ExcelType.XLS;

src/MiniExcel/MiniExcel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using MiniExcelLibs.OpenXml;
44
using MiniExcelLibs.Utils;
55
using MiniExcelLibs.Zip;
6+
using System;
67
using System.Collections.Generic;
78
using System.Data;
89
using System.IO;
@@ -12,6 +13,8 @@ public static partial class MiniExcel
1213
{
1314
public static void SaveAs(string path, object value, bool printHeader = true, string sheetName = "Sheet1", ExcelType excelType = ExcelType.UNKNOWN, IConfiguration configuration = null)
1415
{
16+
if (Path.GetExtension(path).ToLowerInvariant() == ".xlsm")
17+
throw new NotSupportedException("MiniExcel SaveAs not support xlsm");
1518
using (FileStream stream = new FileStream(path, FileMode.CreateNew))
1619
SaveAs(stream, value, printHeader, sheetName, GetExcelType(path, excelType), configuration);
1720
}

src/MiniExcel/MiniExcelLibs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net45;netstandard2.0;net5.0</TargetFrameworks>
4-
<Version>0.14.1</Version>
4+
<Version>0.14.3</Version>
55
</PropertyGroup>
66
<PropertyGroup>
77
<AssemblyName>MiniExcel</AssemblyName>

0 commit comments

Comments
 (0)