Una famiglia di software per fogli di calcolo Microsoft con strumenti per l'analisi, la creazione di grafici e la comunicazione dei dati.
Ciao Francesco,
Per ottenere il percorso del Desktop sul Mac, prova la seguente routine:
'=========>>
Option Explicit
'--------->>
Public Sub SpecialFolderExample()
'\ https://www.rondebruin.nl/mac/mac007.htm
' Call AppleScript to get a special folder
Dim NameFolder As String
Dim SpecialFolder As String
' You can use : home, documents, desktop, music, pictures, movies, applications
NameFolder = "desktop" '"documents"
If Int(Val(Application.Version)) > 14 Then
SpecialFolder = _
MacScript("return POSIX path of (path to " & NameFolder & " folder) as string")
'Replace line needed for the special folders Home and documents
SpecialFolder = _
Replace(SpecialFolder, "/Library/Containers/com.microsoft.Excel/Data", "")
Else
SpecialFolder = MacScript("return (path to " & NameFolder & " folder) as string")
End If
MsgBox SpecialFolder
End Sub
'<<=========
Per ottenere il percorso (Mac) di una directory selezionata da te, prova:
'=========>>
Option Explicit
'--------->>
Public Sub Select_Folder_On_Mac()
'\ https://www.rondebruin.nl/mac/mac017.htm
Dim folderPath As String
Dim RootFolder As String
Dim scriptstr As String
On Error Resume Next
RootFolder = MacScript("return (path to desktop folder) as String")
'Or use RootFolder = "Macintosh HD:Users:YourUserName:Desktop:TestMap:"
'Note : for a fixed path use : as seperator in 2011 and 2016
If Val(Application.Version) < 15 Then
scriptstr = "(choose folder with prompt ""Select the folder""" & _
" default location alias """ & RootFolder & """) as string"
Else
scriptstr = "return posix path of (choose folder with prompt ""Select the folder""" & _
" default location alias """ & RootFolder & """) as string"
End If
folderPath = MacScript(scriptstr)
On Error GoTo 0
If folderPath <> "" Then
MsgBox folderPath
End If
End Sub
'<<=========
===
Regards,
Norman