我有以下代码:
Dim objexcel1 As excel.Application
Dim wbexcel1 As excel.Workbook
Dim objSht1 As excel.Worksheet
Set objexcel1 = CreateObject("excel.Application")
'objexcel1.Visible = True 'Remove excel visibilty at start
Set wbexcel1 = objexcel1.Workbooks.Open("C:\CARS.xls")
Set objSht1 = wbexcel1.Worksheets("car")
objSht1.Activate
Columns("A:B").Select
Charts.Add
ActiveChart.chartType = xlXYScatter
我需要运行此代码两次。当我首先运行它运行正常但在第二次运行时它在Columns("A:B").Select
答案 0 :(得分:0)
是的,我得到了它我需要添加引用。