Copy networked file to ThisWorkbook.Path

MSingh
3StarLounger
Posts: 366
Joined: 12 May 2010, 06:49

Copy networked file to ThisWorkbook.Path

Post by MSingh »

Hi,

How can i copy a file over a network to thisworkbook.path?

I tried ..

Dim SrceFile
Dim DestFile

SrceFile = "\\Staffpc\docsStaff\Contacts.mdb"
DestFile = ThisWorkbook.path
FileCopy SrceFile, DestFile

but get Run-time Error '75':
Path/file access error

Thanks again
Mohamed

User avatar
HansV
Administrator
Posts: 78511
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Copy networked file to ThisWorkbook.Path

Post by HansV »

You have to specify the filename as well as the path:

DestFile = ThisWorkbook.path & "\Contacts.mdb"
Best wishes,
Hans