开发者

how to make opening txt file in Excel work like if you right-click in Windows Explorer and Open With Excel?

开发者 https://www.devze.com 2023-01-30 03:05 出处:网络
My application interfa开发者_JAVA百科ces with Excel using tab-delimited Unicode text files.I require that some cells have multiple lines (alt-enter in Excel, produces LF character (10)).

My application interfa开发者_JAVA百科ces with Excel using tab-delimited Unicode text files. I require that some cells have multiple lines (alt-enter in Excel, produces LF character (10)).

If I right-click on the txt file in Explorer and Open With..Excel, it opens correctly. However, if I open Excel, and from within Excel either open the txt file by browsing to it, or open it through the Most Recently Used list, it treats the LF as a CR and creates a new row starting at that point.

How can I get Excel to open the file correctly from within Excel (i.e., open the file the same way as if I had right-clicked on it in Explorer and selected Open With..Excel)?

Edit: Chris Persichetti provided a lot of good information on a related question here.


I think that you should try this: on the ribbon, click the Data tab, then in the "Get External Data" section, click "From Text". this allows you to customize how excel opens the text file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号