使用Aspose.Cells API将宏按钮添加到工作表

时间:2015-06-12 17:09:19

标签: excel excel-2007 aspose aspose-cells

如何通过Aspose.Cells API启用按钮单击调用宏?我无法找到任何文件。 "猜测"方法也没有产生任何结果。

1 个答案:

答案 0 :(得分:0)

新版本支持:

http://www.aspose.com/docs/display/cellsnet/Assign+Macro+to+Form+Control

基本上,您设置“MacroName”属性,如下所示:

#Add words to this list to include them in the game
words = ["Games","Development","Keyboard","Speed","Typer","Anything","Alpha","Zealous","Accurate","Basics","Shortcut","Purpose","Window","Counter","Fortress","Modification","Computer","Science","History","Football","Basketball","Solid","Phantom","Battlefield","Advanced","Warfare","Download","Upload","Antidisestablishmentarianism","Supercalifragilisticexpialidocious","Discombobulation","Liberated","Assassin","Brotherhood","Revelation","Unity","Syndicate","Victory"]
wordcount = 0
maxwords = [len(words)]       

def nextWord():
        global score
        global wordcount
        global maxwords
        global name
        global high_score

        entry.focus_set()

        if entry.get().lower() == words[1].lower():
            score += 1
            wordcount += 1
            wordcounter.config(text="Words: " + str(wordcount))

        elif entry.get().lower() != words[1].lower():
                wronglabel.config(text="WRONG!")

        for i in words[len(maxwords)]:
            entry.delete(0, tkinter.END)
            random.shuffle(words)
            label.config(text=str(words[1]))
            scoreLabel.config(text="Time: " + str(score)+ "s")

def startGame(event):
    nextWord()

wronglabel = tkinter.Label(root, text="", font =("Helvetica, 14"))
wronglabel.pack()