Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Excel in macro and connecting to a network drive question

In the Excel macro there are files located on a server so everyone has the
latest data. The developer connects to the server by hard coding the drive
say E://data/
If a new user maps the server to F:/ the program does not work.
Is there a way to connect using the server name say \\file-evo-01\ ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel in macro and connecting to a network drive question


sPath = "\\file-evo-01\Data\"
workbooks.open sPath & "Myfile.xls"


--
mudraker

If my reply has assisted or failed to assist you I welcome your
Feedback.

www.thecodecage.com
------------------------------------------------------------------------
mudraker's Profile: http://www.thecodecage.com/forumz/member.php?userid=18
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=26861

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Excel in macro and connecting to a network drive question

yes, but I think it will take you right back where you are. As the name of
the Drives are assigned normally with a letter, the description of that name
it is also a choice that IT has the power to change anytime they want. So, by
changing that to the new name, this does not mean that the program will move
along to the long description name. It is very comun that when the Drive
name, lets say G, change along with the description name. So, you need to
chage the name in that case any way.

Out of, I am sure, several options you have, I know two. First, for
Microsoft, in this particular case, there is a good catch. With a little of
imagination, you can centralize the change of the name in a single part so,
this way, if the drive change its name, you can use the macro to read that
position some where in the spread sheet, and then, loaded into the macro and
use it all across.

Second, and I think you are going to love this one, but you need to confirm
if you are the developer or someone capable of understanding how to change
code in the macro and include some more that I can send. Please confirm.

Argy


"Mike S." wrote:

In the Excel macro there are files located on a server so everyone has the
latest data. The developer connects to the server by hard coding the drive
say E://data/
If a new user maps the server to F:/ the program does not work.
Is there a way to connect using the server name say \\file-evo-01\ ?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default Excel in macro and connecting to a network drive question

Hi; Better do this

Public Actual_Book As String
Public Actual_Path As String
Public Location As String

Function Location_Id()
Actual_Book = ActiveWorkbook.Name
Actual_Path = ActiveWorkbook.Path
Location = Actual_Path & "\" & Actual_Book
End Function


Location = is the variable that you change in your code. This will work. If
at any even the Drive changes name, this fuction will pick up the new name.
So no more lost drives and baby-sitting drive's names.

Suggestion, run Location_Id from each and every sheet by creating a clicking
event. This will guarantee that no matter where in the workbook you are, it
will always keep the variable updated. I have found that although is a Public
variable, if by any chance the program crash in any macro, it completly
looses the path memory in the file, resulting in errors when saving it with a
macro. Let me know if you understand.

Argy



"mudraker" wrote:


sPath = "\\file-evo-01\Data\"
workbooks.open sPath & "Myfile.xls"


--
mudraker

If my reply has assisted or failed to assist you I welcome your
Feedback.

www.thecodecage.com
------------------------------------------------------------------------
mudraker's Profile: http://www.thecodecage.com/forumz/member.php?userid=18
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=26861


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
Excel can't open network drive! Meneos Excel Discussion (Misc queries) 3 September 5th 08 12:43 PM
Can't one excel file on network drive? Mesak Excel Discussion (Misc queries) 0 October 11th 05 09:58 AM
Multi-user macro on network drive? xangelusx Excel Discussion (Misc queries) 3 July 25th 05 10:05 PM
Connecting to a network drive using VBA Sri Excel Discussion (Misc queries) 0 June 7th 05 01:45 PM
Link workbooks-C drive to network drive Earl Excel Worksheet Functions 0 April 19th 05 05:50 PM


All times are GMT +1. The time now is 01:05 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"