Solved

Buffalo Terastaion 3400 PC's can see the XLS file but Mac's can't

Posted on 2016-08-12
4
21 Views
Last Modified: 2016-09-12
I set this NAS up about a year ago and everything worked great until a few months ago when users no longer got prompted that the file was open and they could only open it as read-only. Now they can open the file in normal read-write mode but if someone else is working on it they can't save changes. I would like the file to lock if someone has it open.

Recently, this file became invisible to the Mac users except one who had admin rights on the NAS and only the PC's users can access it. The Read-Write issue still exists. I am stumped.

Summary:
1. Need to have read-only on the xlsx file when another user has it opened.
2. Need to have the file visible to Mac users.

Thanks,
Chris
0
Comment
Question by:cj1301
  • 3
4 Comments
 
LVL 17

Accepted Solution

by:
xtermie earned 500 total points (awarded by participants)
ID: 41765140
Here is a macro that will make all files in your shared path read only
Sub ReadOnly2)
    Dim sPath As String
   sPath = "c:\temp\"
    Call setFileReadOnly(sPath)
End Sub

Sub setFileReadOnly(sPath As String)
    Dim sFile As String
    Dim sSubFolder As String
    Dim fsoObject As Scripting.FileSystemObject
    Dim folderObject As Scripting.Folder
    Dim fileObject As Scripting.File

    Set fsoObject = New Scripting.FileSystemObject

    For Each folderObject In fsoObject.GetFolder(sPath).SubFolders
        Debug.Print folderObject.Path
        Call setFileReadOnly(folderObject.Path & "\")
    Next folderObject

    For Each fileObject In fsoObject.GetFolder(sPath).Files
        Debug.Print sPath & fileObject.Name
        SetAttr sPath & fileObject.Name, vbReadOnly
    Next fileObject
End Sub

Open in new window

0
 
LVL 17

Assisted Solution

by:xtermie
xtermie earned 500 total points (awarded by participants)
ID: 41765144
or something like this
Sub SetFilesReadOnly(Optional location As Folder)
    Dim fso As Scripting.FileSystemObject
    Set fso = New Scripting.FileSystemObject

    If location Is Nothing Then
        Set location = fso.GetFolder("C:\Temp")
    End If

    Dim target As File
    For Each target In location.Files
        if instr(target.Filename, ".xls") > 0 then
        target.Attributes = target.Attributes + ReadOnly
        end if
    Next target

    Dim directory As Folder
    For Each directory In location.SubFolders
        SetFilesReadOnly directory
    Next directory
End Sub

Open in new window


You'll should add reference to Microsoft Scripting Runtime
0
 

Author Comment

by:cj1301
ID: 41767788
Do I run this as a script on the NAS? There is no Windows fileserver and most of the local machines are Mac's.
0
 
LVL 17

Expert Comment

by:xtermie
ID: 41793889
Good comment and suggestions provided
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My experience with Windows 10 over a one year period and suggestions for smooth operation
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now