I have a macro spreadsheet that I created in Windows which grabs the folder path that the spreadsheet is currently in, then opens a folder inside that directory.
I use the command shell ("C:\Windows\explorer.exe",1,FolderPath)
where "FolderPath" is the string that has the final folder path to be opened. Is there an equivalent to this command in Linux, and whilst I am at it, MAC OS as well?
First of all, find a way to find out which operating system your macro is running on (hint: look in Help)
Function OSName() As String
Dim keyNode As Object ' com.sun.star.configuration.ConfigurationAccess
GlobalScope.Basiclibraries.LoadLibrary("Tools")
keyNode = Tools.Misc.GetRegistryKeyContent("org.openoffice.Office.Common/Help")
OSName = keyNode.GetByName("System")
End Function
Now you can use the commands specific to each of the systems:
...
Select Case OSName
Case "WIN"
OpenCommand = "explorer"
Case "MAC"
OpenCommand = "open"
Case "UNIX"
OpenCommand = "xdg-open"
End Select
Shell (OpenCommand, 1, FolderPath)
...