PC Review


Reply
Thread Tools Rate Thread

Copy a network file and paste locally using a Macro

 
 
Presto
Guest
Posts: n/a
 
      2nd Apr 2009
Access 2003 macro nubie here.

I have to copy two files from a network location. Both are Access Databases
that need to be stored locally,
then run one of them.

It is currently done via a DOS batch file called by a macro, but I feel this
is a bit clumbsy.(the fewer files the better)
I would like to be able to do this directly within the macro.

So in a nutshell :
1. Copy \\networkpath\mydatabasefile1.mdb and paste to c:\pcdata
2. Copy \\networkpath\mydatabasefile2.mdb and paste to c:\pcdata
3. Run c:\pcdata\mydatabasefile1.mdb

Thanks in advance for your assistance.


 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      3rd Apr 2009
Presto,

No, you can't do file amnipulations with macros. You will need to use a VBA
procedure. The syntax would be:
FileCopy "\\networkpath\mydatabasefile1.mdb" "C:\pcdata\mydatabasefile1.mdb"
Application.FollowHyperlink "C:\pcdata\mydatabasefile1.mdb"

--

Steve Schapel, Microsoft Access MVP


"Presto" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Access 2003 macro nubie here.
>
> I have to copy two files from a network location. Both are Access
> Databases that need to be stored locally,
> then run one of them.
>
> It is currently done via a DOS batch file called by a macro, but I feel
> this is a bit clumbsy.(the fewer files the better)
> I would like to be able to do this directly within the macro.
>
> So in a nutshell :
> 1. Copy \\networkpath\mydatabasefile1.mdb and paste to c:\pcdata
> 2. Copy \\networkpath\mydatabasefile2.mdb and paste to c:\pcdata
> 3. Run c:\pcdata\mydatabasefile1.mdb
>
> Thanks in advance for your assistance.
>

 
Reply With Quote
 
Albert D. Kallal
Guest
Posts: n/a
 
      5th Apr 2009
"Presto" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Access 2003 macro nubie here.
>
> I have to copy two files from a network location. Both are Access
> Databases that need to be stored locally,
> then run one of them.
>
> It is currently done via a DOS batch file called by a macro, but I feel
> this is a bit clumbsy.(the fewer files the better)
> I would like to be able to do this directly within the macro.
>
> So in a nutshell :
> 1. Copy \\networkpath\mydatabasefile1.mdb and paste to c:\pcdata
> 2. Copy \\networkpath\mydatabasefile2.mdb and paste to c:\pcdata
> 3. Run c:\pcdata\mydatabasefile1.mdb
>


Are you willing to try/use code in place of a macro?

The vba code to do the above is:


FileCopy "\\networkpath\mydatabasefile1.mdb",
"c:\pcdata\mydatabasefile1.mdb"
FileCopy "\\networkpath\mydatabasefile2.mdb",
"c:\pcdata\mydatabasefile2.mdb"
Application.FollowHyperlink "c:\pcdata\mydatabasefile1.mdb"



--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)


 
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
Macro to copy and paste values (columns)I have a macro file built C02C04 Microsoft Excel Programming 2 2nd May 2008 01:51 PM
how to copy a cell in excell and paste in a txt file with macro =?Utf-8?B?S3Jpc2huYV9BSg==?= Microsoft Excel Misc 0 21st Jun 2007 09:51 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
Macro to Copy & Paste a Excel file DNKMCA Microsoft Excel Discussion 1 4th Oct 2005 01:54 PM
Select File Copy/Paste Macro Help.... Jay Baker Microsoft Excel Programming 1 14th Jan 2004 01:01 PM


Features
 

Advertising
 

Newsgroups
 


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