excelsheet.Cells(3, 2).Value = Me.Label1.Caption ’串很长
excelsheet.Cells(4, 2).Value = Me.Label2.Caption ’串很长
excelsheet.Cells(5, 2).Value = Me.Label3.Caption ’串很长
excelsheet.Range(Cells(3, 2), Cells(3, 8)).Merge
excelsheet.Range(Cells(4, 2), Cells(4, 8)).Merge
excelsheet.Range(Cells(5, 2), Cells(5, 8)).Merge在程序第一次调用这段代码的时候运行没有问题,
但是关掉excel之后马上又进行的二次调用的时候就出现这个错误:
Method 'Cells' of object '_Global' failedexcel 还是能显示处数据,但是合并没有效果