PC Review


Reply
Thread Tools Rate Thread

Copy Paste a file into a folder with the current dat

 
 
casan.mike@gmail.com
Guest
Posts: n/a
 
      28th Oct 2008
Hi Guys,

I have a problem with this Sub:

---
Sub CopyFiles()

'Create the folder with the current date
MkDir "s:\Aat\APA acc\GEOFFROY\CPI Mensuels\ALL APA Positions
\Database_" & Format(Date, "yyyymmdd")


'Copy the files created with Olympic
Set newDir = "s:\Aat\APA acc\GEOFFROY\CPI Mensuels\ALL APA Positions
\Database_" & Format(Date, "yyyymmdd")
Dim SourceFile, DestinationFile
SourceFile = "Q:\Products\Aat\APA Database\Bonds Database
\fapa_bonds.xls" ' Define source file name.
DestinationFile = newDir
FileCopy SourceFile, DestinationFile ' Copy source to target.


End Sub
---
I managed 'to create the folder with the current date', however, I
cannot move the file to this folder. The error occurs at the line
Set newDir = "......"

Thanks a lot to help me guys, and please don't laugh if it is a simple
"" or (), because I am a beginner...
:-)

Mike


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      28th Oct 2008
Check your earlier post.

(E-Mail Removed) wrote:
>
> Hi Guys,
>
> I have a problem with this Sub:
>
> ---
> Sub CopyFiles()
>
> 'Create the folder with the current date
> MkDir "s:\Aat\APA acc\GEOFFROY\CPI Mensuels\ALL APA Positions
> \Database_" & Format(Date, "yyyymmdd")
>
> 'Copy the files created with Olympic
> Set newDir = "s:\Aat\APA acc\GEOFFROY\CPI Mensuels\ALL APA Positions
> \Database_" & Format(Date, "yyyymmdd")
> Dim SourceFile, DestinationFile
> SourceFile = "Q:\Products\Aat\APA Database\Bonds Database
> \fapa_bonds.xls" ' Define source file name.
> DestinationFile = newDir
> FileCopy SourceFile, DestinationFile ' Copy source to target.
>
> End Sub
> ---
> I managed 'to create the folder with the current date', however, I
> cannot move the file to this folder. The error occurs at the line
> Set newDir = "......"
>
> Thanks a lot to help me guys, and please don't laugh if it is a simple
> "" or (), because I am a beginner...
> :-)
>
> Mike


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Sent Msgs to current folder AND Sent folder vlncheme Microsoft Outlook VBA Programming 0 5th May 2010 03:23 PM
Copy Paste a file into a folder with the current date casan.mike@gmail.com Microsoft Excel Programming 1 28th Oct 2008 04:39 PM
Copy, paste without file name referenced after paste AusTexRich Microsoft Excel Misc 6 23rd Sep 2008 02:57 AM
Macro to copy and paste link to current sheet Lindleman Microsoft Excel Discussion 1 17th Aug 2007 09:00 PM
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Microsoft Excel Programming 1 17th Oct 2005 08:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:37 AM.