tcl加载tcom扩展包的一个实例

###########################################################
#   函数名:readconfig
#   输入参数:无
#   返回参数:返回一个列表。
###########################################################


proc readconfig {} {

package require tcom

#创建com实例
set excel [::tcom::ref createobj Excel.Application]
$excel Visible 1

set workbooks [$excel Workbooks]
#打开指定目录的工作表

set workbook [$workbooks Open {D:\TS\C8500\C85_oltconfig.xls}]
set worksheets [$workbook Worksheets]
set worksheet [$worksheets Item [expr 1]]
set cells [$worksheet Cells]


#取配置文件的2~16行数据。
for {set i 2} {$i <= 55 } {incr i} {

#puts $i

set id [expr $i]
#puts $id
#取第二列中的数据
set cell [$cells Item $id 2]



if {[$cell Value] > 0 } {
#放入到列表中去
#puts [$cell Value]
lappend ex_list [$cell Value]
}
}
#退出excel
$excel Quit

  return $ex_list

}


Overview Tcl Windows API extension overview. Installation Installation requirements and instructions. Win32 raw API Direct access to the Win32 API. Window management Commands related to management of windows. Desktops and Window stations Commands related to desktops and window stations. Windows Shell Windows shell commands. Keyboard and mouse input Simulation of user input and support for system-wide hotkeys. Sound Basic sound functions. Clipboard Commands related to accessing the clipboard. System Operating system and machine configuration and control. Processes, threads and DLLs Commands related to processes, threads and dynamic link libraries. Handles Commands for managing operating system handles. Services Commands for configuring and monitoring Windows services. Network configuration Commands related to network configuration. Disks and Volumes Commands related to disks and volumes. Network shares Commands related to management of network shares. Users and Groups Commands related to user and group accounts. Security and access control Commands related to authentication and access control. Event log Commands relating to reading and writing the Windows event log. Windows INI file Commands for accessing Windows INI files. Console Commands related to Windows consoles. Scheduler Commands related to managing scheduled jobs through the task scheduler. Internationalization Commands related to internationalization. Miscellaneous Various TWAPI ancillary commands. Printers Printer management. Examples Tcl Windows API usage examples. Version History Tcl Windows API extension version history.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值