简体   繁体   English

Excel转tsv自动更新

[英]Excel to tsv automatic updation

Is there any scrips or tooling that could convert all the excel changes / editions dynamically into the tsv file ? 是否有任何脚本或工具可以将所有Excel更改/版本动态转换为tsv文件? My requirement is to make the changes done in the excel sheet to get reflected on to the tsv file of the same dynamically, the moment we save the excel sheet, its tsv should be edited and should contained the modification. 我的要求是在excel工作表中进行更改,以动态地反映到同一文件的tsv文件中。在保存excel工作表的那一刻,应编辑其tsv并应包含所做的修改。

Thanks in advance guys!! 在此先感谢大家!

This VBA macro is based on work over at Mr. Excel but extended to save in two formats at once. 此VBA宏基于Excel先生的工作,但扩展为可以一次以两种格式保存。

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

' break the save
Cancel = True

' perform the save wourself
Application.EnableEvents = False
Me.SaveAs Filename:="c:\tmp\x.xlsm", _
        FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Application.EnableEvents = True

' do something after the save

Me.SaveAs Filename:="c:\tmp\x.tsv", _
        FileFormat:=xlCurrentPlatformText, CreateBackup:=False    
MsgBox "Workbook is saved in xlsm and tsv"    

End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM