问题
After reinstalling Office 2013 I got this error:
Run-time error '-21474178848 (80010108)':
Method 'Copy' of object 'Sheets' failed
In this the code block:
Set ThisWork = ActiveWorkbook
strExt = ThisWork.Sheets("Catalog1").Cells(2, 4).Value & "_" & Format(Now, "yyyy_mm_dd_hhmmss")
strSaveName = ThisWork.Path & "\" & strExt & ".xlsx"
ThisWork.Sheets(Array("Catalog1", "Catalog2", "Translations")).Copy
With ActiveWorkbook
...
After pressing debug and pressing Continue (F5), Excel crashes.
Why does this happen?
回答1:
Check Sheets names in VBA Windows
In your case it probable wrong names in (name) section which depends on Excel localization. try to change (name) value which you have probably sheet1 or sheet2 and change it to Catalog1 or Catalog2 so whey must much name section.
So now you may have
Sheet1 (Catalog1)
Sheet2 (Catalog2)
You must rename to
Catalog1 (Catalog1)
Catalog2 (Catalog2)
来源:https://stackoverflow.com/questions/34493808/method-copy-of-object-sheets-failed