Solved

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

Posted on 2016-08-12
4
19 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Outlook Free & Paid Tools
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

708 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

12 Experts available now in Live!

Get 1:1 Help Now