+ Reply to Thread
Results 1 to 5 of 5

using File Copy VBA

  1. #1
    Registered User
    Join Date
    08-23-2012
    Location
    Haleyville,Alabama
    MS-Off Ver
    Excel 2010
    Posts
    65

    using File Copy VBA

    Thanks for looking.

    Im having trouble getting the code to FileCopy the active workbook. Any suggestions? Thanks again

    ActiveWorkbook.save
    On Error Resume Next
    Kill "C:\VBA Code\Book5.xls"
    On Error GoTo 0
    FileCopy :="ActiveWorkbook", Destination:="C:\VBA Code\Book5.xls"
    End Sub

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: using File Copy VBA

    Here is some code on the subject

    http://www.rondebruin.nl/folder.htm
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    08-23-2012
    Location
    Haleyville,Alabama
    MS-Off Ver
    Excel 2010
    Posts
    65

    Re: using File Copy VBA

    Thanks for the info that has alot of useful information..
    The problem im having is that it doesnt show how to do the ActiveWorkbook with the filecopy as shown below

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: using File Copy VBA

    Since the active file is open, don't you really just want to save it to a destination and not copy it?

    http://msdn.microsoft.com/en-us/libr...ffice.14).aspx

  5. #5
    Registered User
    Join Date
    08-23-2012
    Location
    Haleyville,Alabama
    MS-Off Ver
    Excel 2010
    Posts
    65

    Re: using File Copy VBA

    I was hoping there was just a simple fix to the small bit of code I had posted, but it seems to be a little more complex than I thought. The code below is the whole Sub the Red highlighted area is where I need another copy made of the ActiveWorkbook.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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