How to open existing Excel file using TCL?

2019-08-18 02:29发布

I have a question to open an existing Excel file with Tcl. In this case, I do not want to get datas from the file but I want to call the Excel file and open it directly.

Does anyone know how to open an existing Excel file with Tcl Tk, and make it stay open?

标签: excel file tcl
1条回答
Luminary・发光体
2楼-- · 2019-08-18 03:15

The simplest thing to try is this:

# For convenience only, put the filename in a variable
set theExcelFile "FooBar.xlsx"

# Ask the OS to mimic a double-click on the file
exec {*}[auto_execok start] "" [file nativename [file normalize $theExcelFile]]

It will work with any file type registered with Windows.

查看更多
登录 后发表回答