Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Macro to Put network path in cell

Hi all, The Macro below put path in cell A1 which is "F:\Documents\Data
\Record.xlsx"

Sub getpath()
Range("A1").Value = ThisWorkbook.FullName
End Sub

I work in office and we save everything on network drive. The above
file or path is actually in "\\Home\Trader\Documents\Data
\Record.xlsx". Please can any friend can help that how can I make
appear network path instead of drive path in cell A1. I tried code
below to achive what i want but there must be some way in excel vba to
get network path by code.

Sub getpath()
Range("A1").Value = "\\Home\Trader" & Right(ThisWorkbook.FullName, Len
(ThisWorkbook.FullName) - 2)
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Macro to Put network path in cell

Refer the below link on UNC path
http://support.microsoft.com/kb/160529

--
If this post helps click Yes
---------------
Jacob Skaria


"K" wrote:

Hi all, The Macro below put path in cell A1 which is "F:\Documents\Data
\Record.xlsx"

Sub getpath()
Range("A1").Value = ThisWorkbook.FullName
End Sub

I work in office and we save everything on network drive. The above
file or path is actually in "\\Home\Trader\Documents\Data
\Record.xlsx". Please can any friend can help that how can I make
appear network path instead of drive path in cell A1. I tried code
below to achive what i want but there must be some way in excel vba to
get network path by code.

Sub getpath()
Range("A1").Value = "\\Home\Trader" & Right(ThisWorkbook.FullName, Len
(ThisWorkbook.FullName) - 2)
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Macro to Put network path in cell

One more
http://www.freevbcode.com/ShowCode.asp?ID=397

If this post helps click Yes
---------------
Jacob Skaria


"K" wrote:

Hi all, The Macro below put path in cell A1 which is "F:\Documents\Data
\Record.xlsx"

Sub getpath()
Range("A1").Value = ThisWorkbook.FullName
End Sub

I work in office and we save everything on network drive. The above
file or path is actually in "\\Home\Trader\Documents\Data
\Record.xlsx". Please can any friend can help that how can I make
appear network path instead of drive path in cell A1. I tried code
below to achive what i want but there must be some way in excel vba to
get network path by code.

Sub getpath()
Range("A1").Value = "\\Home\Trader" & Right(ThisWorkbook.FullName, Len
(ThisWorkbook.FullName) - 2)
End Sub

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
Problem with this VBA Code and Network Printers (UNC Path) Holger Hasenmüller Excel Programming 12 April 21st 08 10:55 PM
Path to a network drive CWillis Excel Discussion (Misc queries) 2 June 23rd 06 03:06 AM
Open Workbook using URL instead of network path Raul Excel Programming 5 March 1st 06 03:53 PM
Saving to a Network Path using VBA Mike R Excel Programming 1 August 11th 03 10:34 AM
Network Path Karen[_5_] Excel Programming 2 August 5th 03 12:05 PM


All times are GMT +1. The time now is 07:27 AM.

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"