Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-28-2016, 04:08 AM
gmayor's Avatar
gmayor gmayor is offline VBA Code to copy file to folder and keep the original. Windows 10 VBA Code to copy file to folder and keep the original. Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The macro (use the code button - # - to format your codes), which is very loosely based on a macro I helped you with, in response to an earlier question.

You have filled a load of string variables from values (that hopefully exist - though there is no error checking), some of which have no apparent purpose, although IO have not delved too deeply, and you have assigned your default path to two separate variables?

Without referring back to the original macro to check, I seem to recall that the process there renamed a sub folder if it existed?

If there is a file in your folder defined at strpath and strdrive called rp.vcp then it can be copied easily enough using the command
Code:
FileCopy strDrive & "rp.vcp", strDrive & FOLDER & "\rp.vcp"
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code to copy file to folder and keep the original. vba code for folder name, subfolder directory, file name & revision times klpw Excel Programming 2 12-24-2015 12:31 AM
Copy and paste file but folder doesn't update Haha88 Windows 2 09-24-2015 09:54 AM
VBA Code to copy file to folder and keep the original. Keeping track of the original file when you copy/paste sidbisk Excel 2 09-01-2015 02:11 PM
unable to copy / move file from Outlook preview pane to zip folder dgiardina Outlook 0 01-26-2015 06:33 AM
'Save As' to same folder as original opened file thepuppyprince Office 0 01-18-2013 08:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft