+ Reply to Thread
Results 1 to 6 of 6

Errors when coying to another workbook

  1. #1
    Registered User
    Join Date
    12-18-2021
    Location
    Barcelona, Spain
    MS-Off Ver
    MS Office 365
    Posts
    12

    Errors when coying to another workbook

    Hello,

    Let me explain my problem.

    I have created a cost sheet for my restaurant that works quite well, with the help of forums and ChatGPT. I'm just a chef so be gentle

    In the first workbook, "Costes", I do the cost calculation, and once finished I copy it to the "escandallo" book using a macro button.

    The problem is that the macros from "Costes Esferic" are also copied, which causes errors. I would like only the sheet with the formulas to be copied, without the macros, and for it to be complete.

    I have attached both books.

    Any help will be greatly appreciated.

    Cheers,
    R
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Errors when coying to another workbook


    Hola !

    So do not copy the workbook but SaveCopyAs to a temp workbook file.
    Open this temp workbook then SaveAs to standard format .xlsx : no more 'macro' included !
    Then delete the temp workbook …

  3. #3
    Registered User
    Join Date
    12-18-2021
    Location
    Barcelona, Spain
    MS-Off Ver
    MS Office 365
    Posts
    12

    Re: Errors when coying to another workbook

    Thank you for your reply Marc!

    I managed to delete de macros but the problem comes from the following code, which is on the cost sheet and gets copied to the other sheet.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-18-2021
    Location
    Barcelona, Spain
    MS-Off Ver
    MS Office 365
    Posts
    12

    Re: Errors when coying to another workbook

    Wait a minute, now I get it...

    I saved it as .xlsx and I got rid of the errors. Anyway, would it be a more "elegant" way of sorting it out though?

    Thank you so much !

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Errors when coying to another workbook


    If the worksheet does not contain any code within its module so you can use the Copy method
    to create a new workbook just containing the same worksheet …

  6. #6
    Registered User
    Join Date
    12-18-2021
    Location
    Barcelona, Spain
    MS-Off Ver
    MS Office 365
    Posts
    12

    Re: Errors when coying to another workbook

    Ok, the next code is the one giving me the error and is located in VBAProject (COSTES.xlsb)/Objects/Sheet1
    Should I put it somewhere else?

    HTML Code: 
    Both macros for copying and deleting are located in the Modules folder and they get deleted via macro with this code:

    HTML Code: 
    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do you handle errors from another workbook?
    By dmasters4919 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2015, 04:30 PM
  2. [SOLVED] VBA for Coying Files and folders
    By mvinay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2014, 01:49 AM
  3. #DIV/0! Errors when pulling from another workbook?
    By CRUSROD in forum Excel General
    Replies: 1
    Last Post: 07-19-2012, 05:42 PM
  4. [SOLVED] Taking the Tab Name and coying to a cell in the worksheet
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 05-24-2012, 06:47 PM
  5. New Workbook/Cut Errors
    By ultimastryder in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-23-2010, 05:56 PM
  6. Can I turn of all #value! errors in a workbook
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2010, 01:31 AM
  7. [SOLVED] Excel data is not coying correctly into Ms-Word
    By Anney in forum Excel General
    Replies: 2
    Last Post: 10-03-2005, 12:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1