Copying Worksheets from one Workbook to Another – Error 1004

I was working on a project using Excel 2010  where I had to copy entire worksheets from one workbook to another.  I was doing this through some vba code.  When I attempted to save the target file, I would get an error.  The error message was vba 1004 — with a message of:

Errors were detected while saving ‘c:\filefolder\filename.xlsx’.  Microsoft Excel may be able to save the file by removing or repairing some features.

It took quite a bit of research to figure out what was going on.  Luckily, I stumbled onto this KB from Microsoft.  It appears this is caused by a known bug.  You cannot save a workbook that contains an image that was copied from another workbook in Excel 2010 – unless a patch has been applied to Excel.  Here is the link to the KB:

Hope this saves someone some time.

This entry was posted in Excel Tips, VBA Code. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s