问题描述
我目前在Windows中有一个perl程序,可以通过Spreadsheet :: WriteExcel创建并填充一个excel文件,但是我想在程序关闭时打开该文件.我尝试使用Google搜索以获取信息,但是发现的所有内容都是如何在perl中打开和读取excel文件.有人可以帮助我吗?
I currently have a perl program in Windows that creates and populates an excel file via Spreadsheet::WriteExcel, but I'd like to have that file opened as my program closes. I tried googling for information, but all I found was how to open and read excel files within perl. Would anyone be able to help me?
推荐答案
我建议这样做:
`your_file.xls`;
它仅执行系统命令.假设将Excel文件设置为默认情况下可以使用Excel打开,则此方法可以起作用(根据您的设置,可能需要或可能不需要向文件添加完整路径).
It just executes a system command. Assuming Excel files are set to default open with Excel, this will work (adding the full path to the file may or may not be necessary, depending on your setup).
其他选项:
system("your_file.xls");
`C:\\Program Files\\...\\excel.exe your_file.xls`;
system("C:\\Program Files\\...\\excel.exe your_file.xls");
这篇关于如何从perl程序中打开Excel(该程序,而不是文件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!