主题
Name (属性)
返回一个 str 值,它代表对象的名称。
示例
python
#首先用宏语言,然后用用户语言显示活动工作簿中的第一种样式的名称
def test():
sty = Application.ActiveWorkbook.Styles.Item(1)
print("The name of the style: " + sty.Name)
print("The localized name of the style: " + sty.NameLocal)
python
#显示活动工作簿的 Sheet1 中的默认 ListObject 对象的名称
def test():
wrksht = Application.ActiveWorkbook.Worksheets.Item("Sheet1")
oListObj = wrksht.ListObjects.Item(1)
print(oListObj.Name)