#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default marco

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
..


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default marco

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
.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default marco

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
.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
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
.


.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default marco

Hi David,

That means that the file does indeed exist in that UNC location. So that
rules out a bad path. One thing to try (should have thought of this
earlier) - make sure "Ignore other applications" is *unchecked* in Tools |
Options / General tab in Excel. If it's checked, it can cause problems when
files are launched from Explorer.

--
Regards,

Jake Marx
MS MVP - Excel

David Kuehl wrote:
If I enter that in and then hit enter it returns
CurrentFile.xls. Now I am really confused.

-----Original Message-----
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
.

.


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marco Puzzled Excel Discussion (Misc queries) 3 July 30th 07 05:09 PM
Marco Help looper Excel Discussion (Misc queries) 2 May 12th 07 06:55 PM
marco to format top 80% NN Excel Discussion (Misc queries) 3 January 17th 06 05:51 PM
I need some help with a Marco xgunda420x Excel Discussion (Misc queries) 2 August 2nd 05 01:43 PM
Marco Loi New Users to Excel 4 December 7th 04 08:52 PM


All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"