How to access local folder over network

egalitarian

New Member
Joined
Jul 23, 2010
Messages
1
Dear Experts,

i have an excel file that reads directory data from a certain folder. Since its in my local machine, it works great as required.

However, the problem now is that i am going to put the excel file in network drive so that my other colleague can access it too. its function will still be the same and that is to read data from my local drive.

The following is my code. Please kindly enlighten me as to how make my file read my local data across the network? Any kind of help will be greatly appreciated. I am using Excel 2003.

******Code*******

Sub getReleaseFolderName()
Dim xRow&, vSF
Dim yRow&, wSF
Dim xDirect$, InitialFoldr$
Dim FSO
Dim itemNo As Integer
Dim folderNameCell

' Startup folder to begin searching from
InitialFoldr$ = "C:\Releases\Release 3\Releases"
Sheet3.Activate

'Confirm if the folder exists
Set FSO = CreateObject("Scripting.FileSystemObject")
If Not FSO.FolderExists(InitialFoldr$) Then
MsgBox InitialFoldr$ & " do not exists! Check Settings Worksheet.", vbExclamation, "Folder Do Not Exists"
Else
xDirect$ = InitialFoldr$ & "\"
End If

'If the folder exists, look for files, subfolders and print out their name
If xDirect$ <> "" Then
With CreateObject("Scripting.FileSystemObject").GetFolder(xDirect$)
For Each vSF In .SubFolders
Range("A11").Offset(xRow) = itemNo + 1
Range("B11").Offset(xRow) = vSF.DateCreated
Range("C11").Offset(xRow) = vSF.Name
With CreateObject("Scripting.FileSystemObject").GetFolder(vSF)
For Each wSF In .Files
If wSF.Type = "Adobe Acrobat Document" Then
' Add hyperlinks to files
ActiveSheet.Hyperlinks.Add Anchor:=Range("D11").Offset(yRow), Address:= _
wSF, TextToDisplay:=wSF.Name
Else
Range("D11").Offset(yRow) = wSF.Name
End If
yRow = yRow + 1
Next wSF
For Each wSF In .SubFolders
ActiveSheet.Hyperlinks.Add Anchor:=Range("D11").Offset(yRow), Address:= _
wSF, TextToDisplay:=wSF.Name
yRow = yRow + 1
Next wSF
End With
xRow = yRow
itemNo = itemNo + 1
Next vSF
End With
End If
End Sub
******* End Code*****
 
Last edited:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hello and welcome to The Board.
I believe that it is possible to set up a 'network share' but I have never come across that being used in a work environment. Personally I would not be too happy with that.
For what you want to do I would consider adding code to my workbook(s) to copy it to the network drive (where it would be accessible) wheneve I saved it.
 
Upvote 0
Use the excel data connections rather than the code pulling the data.

Create your raw data table, store it on the network. In your excel sheet click on the Data--> Connections Option. You can connect to SQL, Access, Excel, TXT files etc...
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,546
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top