Skip to content
/ ImportExcel Public
  • Notifications You must be signed in to change notification settings
  • Fork 392
  • Star 2.4k
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to bottom

Property value evaluated as invalid formula requires repair #1292

Closed
msftrncs opened this issue Oct 24, 2022 · 6 comments
Closed

Property value evaluated as invalid formula requires repair #1292

msftrncs opened this issue Oct 24, 2022 · 6 comments
Labels
wontfix

Comments

@msftrncs
Copy link

msftrncs commented Oct 24, 2022

This creates a damanged xlsx file.

[pscustomobject]@{Description = '=====TEST===='} | export-excel .\test.xlsx -WorksheetName 'test' -ClearSheet

image

image

image

Is there a method/parameter to indicate that a property is strictly text and not to even be interpreted as a formula? -NoNumberConversion handles only strictly the case when the value could be interpreted as a number.

Reading the file back in with Open-ExcelPackage I can confirm the value was taken as a formula:

Style                 : OfficeOpenXml.Style.ExcelStyle
StyleName             : Normal
StyleID               : 0
Value                 : 
Text                  : 
Formula               : ====TEST====
FormulaR1C1           : 
Hyperlink             : 
Merge                 : False
AutoFilter            : False
IsRichText            : False
IsArrayFormula        : False
RichText              : {}
Comment               : 
Worksheet             : test
FullAddress           : 'test'!A2
FullAddressAbsolute   : 'test'!$A$2
ConditionalFormatting : OfficeOpenXml.ConditionalFormatting.RangeConditionalFormatting
DataValidation        : OfficeOpenXml.DataValidation.RangeDataValidation
Current               : 
Address               : A2
Start                 : OfficeOpenXml.ExcelCellAddress
End                   : OfficeOpenXml.ExcelCellAddress
Table                 : 
IsName                : False
Rows                  : 1
Columns               : 1
@dfinke
Copy link
Owner

dfinke commented Oct 25, 2022

No, there is no way for designate as text vs formula.

You can add a single quote at the start.

[pscustomobject]@{Description = "'=====TEST====" } | export-excel .\test.xlsx -WorksheetName 'test' -ClearSheet -Show

@msftrncs
Copy link
Author

msftrncs commented Oct 25, 2022

Adding a single quote doesn't work correctly. Excel then displays this single quote, and reimporting the sheet also exposes this single quote. :(

image

@stahler
Copy link
Contributor

stahler commented Oct 25, 2022

You would have a similar issue if you did this directly in Excel. After entering the cell and hitting F2 (you have probably seen this with Hyperlinks as well), Excel sees it as you want it to and re-consuming it shows it as text.
image

@msftrncs
Copy link
Author

msftrncs commented Oct 26, 2022

You would have a similar issue if you did this directly in Excel.

If you mean entering ====TEST==== would be evaluated as a formula, YES, except I know to use '====TEST==== and Excel will treat it as text, and it does NOT show the quote, if it even stores it. When I Import-Excel with such an input, the quote is not returned. If I put a single quote in front of the value when using Export-Excel, it is NOT the same as doing it in Excel, as now Excel displays the quote, and Import-Excel returns it.

I would think that there should be a means to signal that a column/property is strictly text (at least if it is string type), not to be interpreted as a formula, and also set the QuotePrefix style property where required to emulate the same behavior experienced within Excel. This would be better than -NoNumberConversion as that still leaves the cell value in a way it could be reevaluated, if the NumberFormat style is not set to Text.

Alternately the automatic formula assumption could be disabled if the NumberFormat style is set to Text. While Excel will accept switching the format to Text after the formula is entered, you cannot enter a formula afterwards.

@dfinke
Copy link
Owner

dfinke commented Oct 26, 2022

This is an edge case. Need to think about it more.

@stale
Copy link

stale bot commented Dec 24, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 24, 2022
@stale stale bot closed this as completed Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix
Projects
None yet
Development

No branches or pull requests

3 participants
@dfinke @stahler @msftrncs

Footer

© 2024 GitHub, Inc.

玻璃钢生产厂家婴儿玻璃钢雕塑阳江玻璃钢气球雕塑开福玻璃钢卡通雕塑玻璃钢园林雕塑深圳周年庆典商场美陈哪里买泥塑及玻璃钢雕塑设计工厂工艺玻璃钢雕塑源头好货鹰潭桃子玻璃钢雕塑厂北京玻璃钢雕塑厂家性价比出众兰考玻璃钢雕塑费用平顶山仿古校园玻璃钢雕塑公司四川受欢迎的成都商场美陈宝应玻璃钢雕塑厂舟山玻璃钢陶瓷雕塑企业天津天河玻璃钢人物雕塑双鸭山玻璃钢雕塑订制价格舟山人物玻璃钢雕塑批发河西春节商场美陈晋城铜校园玻璃钢雕塑厂家杭州卡通人玻璃钢花盆通许玻璃钢雕塑定制商场亲子活动美陈玻璃钢雕塑选择惠新联系方式香橙玻璃钢卡通雕塑厂广州玻璃钢卡通雕塑报价商场春节大门美陈如何生产玻璃钢雕塑玻璃钢仿真月饼模型雕塑江西玻璃钢花盆哪家好官渡区玻璃钢雕塑定做厂家多少钱香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声单亲妈妈陷入热恋 14岁儿子报警汪小菲曝离婚始末遭遇山火的松茸之乡雅江山火三名扑火人员牺牲系谣言何赛飞追着代拍打萧美琴窜访捷克 外交部回应卫健委通报少年有偿捐血浆16次猝死手机成瘾是影响睡眠质量重要因素高校汽车撞人致3死16伤 司机系学生315晚会后胖东来又人满为患了小米汽车超级工厂正式揭幕中国拥有亿元资产的家庭达13.3万户周杰伦一审败诉网易男孩8年未见母亲被告知被遗忘许家印被限制高消费饲养员用铁锨驱打大熊猫被辞退男子被猫抓伤后确诊“猫抓病”特朗普无法缴纳4.54亿美元罚金倪萍分享减重40斤方法联合利华开始重组张家界的山上“长”满了韩国人?张立群任西安交通大学校长杨倩无缘巴黎奥运“重生之我在北大当嫡校长”黑马情侣提车了专访95后高颜值猪保姆考生莫言也上北大硕士复试名单了网友洛杉矶偶遇贾玲专家建议不必谈骨泥色变沉迷短剧的人就像掉进了杀猪盘奥巴马现身唐宁街 黑色着装引猜测七年后宇文玥被薅头发捞上岸事业单位女子向同事水杯投不明物质凯特王妃现身!外出购物视频曝光河南驻马店通报西平中学跳楼事件王树国卸任西安交大校长 师生送别恒大被罚41.75亿到底怎么缴男子被流浪猫绊倒 投喂者赔24万房客欠租失踪 房东直发愁西双版纳热带植物园回应蜉蝣大爆发钱人豪晒法院裁定实锤抄袭外国人感慨凌晨的中国很安全胖东来员工每周单休无小长假白宫:哈马斯三号人物被杀测试车高速逃费 小米:已补缴老人退休金被冒领16年 金额超20万

玻璃钢生产厂家 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化