如何使用TCL打开现有的Excel文件? [英] How to open existing Excel file using TCL?

查看:562
本文介绍了如何使用TCL打开现有的Excel文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题要使用Tcl打开现有的Excel文件.在这种情况下,我不想从文件中获取数据,但是我想调用Excel文件并直接将其打开.

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.

有人知道如何使用Tcl Tk打开现有的Excel文件并使其保持打开状态吗?

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

推荐答案

最简单的尝试是:

# 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]]

它将与Windows注册的任何文件类型一起使用.

It will work with any file type registered with Windows.

这篇关于如何使用TCL打开现有的Excel文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆