每次Excel.open完成后,你能为变量添加一个吗?
像这样:模块myEXCEL Public Datafilename As String Public Counter as Integer Public xlDATA As New Excel.Application Public xlDATAWorkbook As Excel.Workboo ...
至于button2问题:你需要将EXCEL的东西声明为PUBLIC,这样所有例程都可以使用它。
像这样,然后Button1_click和Button2_click可以使用EXCEL:Public xlDATA As New Excel.Application Public xlDATAWorkbook As Exce ...