如何从 VB.NET 代码在 Excel 中打开制表符分隔的 .txt 文件?
这个问题已经在许多论坛上提出过,但我在任何地方都找不到真正解决这个问题的答案。
Dim fileName As String = "file.txt"
Dim filePath As String = System.Reflection.Assembly.GetExecutingAssembly().Location
Dim fullFilePath As String = filePath.Substring(0, filePath.LastIndexOf("\"c)) & "\" & fileName
Public Sub OpenFileInExcel()
Process.Start("excel.exe", fullFilePath)
End Sub