Thread: marco
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_2_] Jake Marx[_2_] is offline
external usenet poster
 
Posts: 23
Default marco

Hi David,

The Immediate window is available in the VBE (Visual Basic Editor). Just
hit Ctrl+G and it should appear below the code pane. Typing ? before a
statement that returns a value will cause it to output the value in the
window. It's a sort of command window. A UNC is a Universal Naming
Convention, which allows you to map the path to a file without mapping a
drive. As you've done, it is constructed as
\\servername\sharedfolder\subfolder\filename.

Anyway, if you do a ?Dir$("<yourUNCpath") in the Immediate window, you will
see if the path is correct and/or accessible.

--
Regards,

Jake Marx
MS MVP - Excel

David Kuehl wrote:
I am not a programmer by trade (I guess that is obvious).
What is a UNC path and what do you mean by Immediate
window? I I replace the line in my macro with it I get a
complier error "method not valid without suitable object".
I do appreciate your help.

-----Original Message-----
Hi David,

Are you sure you have the correct UNC path to the file? What does
this return when entered via the Immediate window?

?Dir$("\\DKUEHL-ras1\info_website\CurrentFile.xls")


--
Regards,

Jake Marx
MS MVP - Excel

David Kuehl wrote:
I have created several marco's in Excel and they work
great when you map to the drive they are on and run them
normal. If you try to run them through Explorer it gives
an error.

Run-time error '1004':

Method 'Open' of object "Workbooks" failed

The line of code it points to in the macro is as follows:

Workbooks.open Filename:="\\DKUEHL-ras1
\info_website\CurrentFile.xls

DKUEHL-ras1 is the name of the server. I am at a lost what
it is looking or asking for
.


.