擅长:python、mysql、java
<p>我不确定这是你想要的结果,不幸的是它没有使用win32com.客户端但是comtypes.客户端,但如果您尝试:</p>
<pre><code>import comtypes.client # unfortunately not win32com
excel = comtypes.client.CreateObject('Excel.Application')
fileName = r"myFile.xlsx" # I used .xlsx but should work with .xlsm
myBook = excel.Workbooks.Open(fileName)
mySheet = myBook.Sheets('Sheet1')
myRange = mySheet.Range('I3:AL32')
myState = myRange.Value(11) #with comtypes.client you can use the parameter 11
print myState
</code></pre>
<p>您可以打印如下内容:</p>
^{pr2}$
<p>在这里你可以找到我在例子中使用的不同颜色的代码。
希望它对你有用,即使它不是用win32com。在</p>