View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Rollins Tom Rollins is offline
external usenet poster
 
Posts: 3
Default Filecopy and UNC-pathname

I have found the same need. There is somewhat of a work around. You can
create a hyperlink in a workbook (either manually or by VBA) that uses a
UNC. Then you can follow that hyperlink from within VBA using
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True.

Tom


"Jos Vens" wrote in message
...
Hi Bob,

F is the logical drive (partition of my harddisk), not a mapped drive.
Maybe there is a solution to use a mapped drive letter in stead of a
UNC-path.

The reason for using a unc-path is that it can be perfectly done within

VBA
(with an API-call - if it is possible to make a mapped drive in VBA, it's

ok
for me) and the user can put the data whereever he wants, the program

(which
is in C:\Program Files) is an addin (.xla) and finds the data, even over

the
network.

However, copying new data to the user's datafolder (with UNC - it's the
destination folder that must be with a drive letter, not \\) gives an

error
message.

Can you help me further?

Thanks
Jos Vens

"Bob Phillips" schreef in bericht
...
Jos,

I am confused. I assume that F is the local mapped drive letter? If so,

why
are you using the UNC, why not just use the mapped drive letter?

As to the question, Randy Birch shows how to enumerate local network
resources, but this takes a lot of code, and maybe is overkill for you.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jos Vens" wrote in message
...
Hi,

I discovered that it is not possible to use the FileCopy statement in
junction with a UNC pathname.

eg. FileCopy "C:\TEMP\Test.xls", "F:\LibraData\Test.xls" works fine
FileCopy "C:\TEMP\Test.xls", "\\Acer01\LibraData\Test.xls" don't

works.
I
get the error message: 75 cannot access... however, LibraData is

shared
on
my computer with the name Acer01.

How can I solve this (I don't know on which drive the user has placed

his
data). Is it possible to get the local pathname out of the shared UNC
pathname (so that \\Acer01\ is translated to eg. F:\) or is there an
alternative for the FileCopy statement?

Thanks
Jos Vens