0
请帮我看一下透视图的自动化,下面是我写的代码。我目前正在创建图表excel 2007中透视图的自动化
require "rubygems"
# require "watir" # Commented out by editor to the question, not by the OP
require 'win32ole'
excel=WIN32OLE.new("Excel.Application")
excel.visible=true
work_book=excel.Workbooks.Open("C:\\VAMSI\\PIVOTAL_CHART_CODE\\pivotal.xlsx")
worksheet = work_book.worksheets(1)
worksheet.range("a1").select
autoit= WIN32OLE.new("AutoItX3.Control")
autoit.Send("!n")
autoit.Send("!v")
autoit.Send("!t")
autoit.Send("{ENTER}")
感谢您的快速答复Željko菲律宾,我知道这是不涉及watir,我有做了几件事情的Excel自动化,但在这里我想创建一个数据透视表,并没有想法做到这一点。 – Vam 2011-05-16 08:20:20
我不知道什么是数据透视图。如果你知道这个问题与Watir无关,你为什么要标记它? :) – 2011-05-16 11:23:36
它不应该被标记为watir,它完全关于win32ole对象,问题是如何使用ruby自动化Micorsoft Excel数据透视图:) – Vam 2011-05-16 12:40:26