在Python中使用Active -X DLL [英] Using an Active -X DLL in Python

查看:380
本文介绍了在Python中使用Active -X DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
请通过解释如何在
中加载Active-X DLL来帮助我 一个Python程序以及如何在我的Python程序中使用它的功能.

Hello friends,
Please help me by explaining how to load an Active-X DLL in
a Python program and how to used its functions in my Python program.

推荐答案

在此处安装"Python for Windows扩展":

http://sourceforge.net/projects/pywin32/ [
Install the "Python for windows extensions" here:

http://sourceforge.net/projects/pywin32/[^]

And for example invoking excel will be possible:

import win32com.client
import pythoncom

xlApp = win32com.client.Dispatch("Excel.Application")
xlApp.Visible=1

workBook = xlApp.Workbooks.Open(r"C:\MyTest.xls")
print str(workBook.ActiveSheet.Cells(i,1))
workBook.ActiveSheet.Cells(1, 1).Value = "hello"                
workBook.Close(SaveChanges=0) 
xlApp.Quit()


这里是调用ADO的链接:

http://www.ecp.cc/pyado.html [


Here a link for invoking ADO:

http://www.ecp.cc/pyado.html[^]

Good luck!


这篇关于在Python中使用Active -X DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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