Excel报表问题,求救
我预览一次没有问题,但是再次运行预览报表的时候就在Range("A7:G7").MergeCells = True这里出错,错误信息为:<Method 'Range' of object '_Global' failed>,请问是何原因?怎么解决?我必须要合并此单元格,有没有其他方法?
Set xlApp = New Excel.Application
xlApp.Visible = False
Set xlBook = xlApp.Workbooks.Open(strDestination)
Set xlSheet = xlBook.Worksheets(1)
Range("A7:G7").MergeCells = True
xlSheet.Cells(7, 1) = Format(dtpDate.Value, "yyyy年mm月dd日")
。。。。。 '填写子表内容
xlBook.Save '保存文件
xlApp.Visible = True
xlSheet.PrintPreview
xlBook.Close (True) '关闭EXCEL工作簿
xlApp.Quit '退出EXCEL
Set xlApp = Nothing