+ Reply to Thread
Results 1 to 3 of 3

runtime error 1004 in copy and close workbook vba code

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    runtime error 1004 in copy and close workbook vba code

    I have a workbook testandclose .xlsm where sheets master copies a template format :c:\\sample \intermartformat by using the code below.

    That is it opens the interformat,xlsx , copy , paste in active workbook and close the interformat sheet.


    but I am getting a runtime error 1004.as in bold red below.


    Can anyone assist






    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: runtime error 1004 in copy and close workbook vba code

    intermartformat.xlsx‎ is actually an older format .xls file. You just renamed it with the .xlsx extension, but you didn't do SaveAs with the .xlsx file type selected.

    Open the file and then do SaveAs. Make sure you select the .xlsx file format Type in the SaveAs dialog.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: runtime error 1004 in copy and close workbook vba code

    Thanks Now working

+ 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. [SOLVED] Runtime error 1004 with my saveas code
    By Anto_BT in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2015, 11:49 AM
  2. Runtime error and workbook won't close
    By Chris.mlyn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2014, 04:45 PM
  3. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  4. Copy sheet from another workbook - runtime error 1004
    By larne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2010, 05:45 AM
  5. Runtime Error Code 1004
    By laks in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-19-2007, 07:08 PM
  6. After sharing workbook VB code stops working. Runtime Error 1004
    By Patrick LaFerriere in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2005, 11:05 AM
  7. shared workbook runtime error 1004
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-02-2005, 02:09 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