对象“ Sheets”的方法“ Copy”失败 [英] Method 'Copy' of object 'Sheets' failed

查看:128
本文介绍了对象“ Sheets”的方法“ Copy”失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重新安装Office 2013之后,出现此错误:

After reinstalling Office 2013 I got this error:


运行时错误'-21474178848(80010108)':

对象'Sheets'的方法'Copy'失败

Run-time error '-21474178848 (80010108)':
Method 'Copy' of object 'Sheets' failed

在此代码块中:

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
...

按调试并按继续( F5 )后,Excel崩溃。

After pressing debug and pressing Continue (F5), Excel crashes.

为什么会这样?

推荐答案

在VBA Windows中检查表格名称

Check Sheets names in VBA Windows

在您的情况下,(名称)部分可能存在错误的名称,具体取决于Excel本地化。尝试更改您可能具有sheet1或sheet2的(名称)值,然后将其更改为Catalog1或Catalog2,这样乳清必须包含很多名称部分。

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.

所以现在您可能拥有

Sheet1 (Catalog1)
Sheet2 (Catalog2)

您必须重命名为

Catalog1 (Catalog1)
Catalog2 (Catalog2)

这篇关于对象“ Sheets”的方法“ Copy”失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆