Sir, I have a excel file & want to select that file using vba code from powerpoint(windows). So I want to create a general vba code which will be applicable for both windows as well as mac so first verify is it windows or mac and then run the code.I have windows so i create below code which open filedialog "C:" drive. How to configure for mac (just open dialog box from where i can browse the file )? Any other solution will be equally appreciated.

Sub SelectFile()


MsgBox "Please select/browse data excel file from your computer! "
Dim fDialog As FileDialog
Dim filepath As String


Set fDialog = Application.FileDialog(msoFileDialogFilePicker)

'Optional: FileDialog properties
fDialog.AllowMultiSelect = False
fDialog.Title = "Select a file"
fDialog.InitialFileName = "C:"
'Optional: Add filters
fDialog.Filters.Clear
fDialog.Filters.Add "Excel files", "*.xlsx"
fDialog.Filters.Add "All files", "*.*"


'Show the dialog. -1 means success!
If fDialog.Show = -1 Then
filepath = fDialog.SelectedItems(1)
Else
End If
End Sub