Share via

msoFileDialogFilePicker alternative for Excel for Mac

Anonymous
2024-07-24T13:12:06+00:00

Hi.

I've read that msoFileDialogFilePicker doesn't really work for Excel for Mac. Is there a way to rewrite this so it works on Mac? I don't really want to buy a new computer just for this one report.

Sub macro()

Dim ingcount&, i&, sFname$

Dim wb As Workbook, wbT As Workbook, ws As Worksheet

Set wbT = ThisWorkbook

With Application.FileDialog(msoFileDialogFilePicker)

.Filters.Add "¯__®¨®€Ëì", "*.txt", 11

.InitialFileName = "*.txt*"

.Title = "INSERT RAW DATA"

.AllowMultiSelect = True

Application.ScreenUpdating = False

Application.DisplayAlerts = False

If .Show = vbFalse Then Exit Sub

For ingcount = 1 To .SelectedItems.Count

Set wb = Workbooks.Open(.SelectedItems(ingcount))

sFname = wb.Name

i = InStr(1, sFname, ".")

sFname = Left(sFname, i - 1)

wbT.Sheets(sFname & " RAW DATA").UsedRange.Clear

wb.Sheets(1).UsedRange.Copy

wbT.Sheets(sFname & " RAW DATA").Range("A1").PasteSpecial

wb.Close False

Next

End With

Application.ScreenUpdating = True

Application.DisplayAlerts = True

MsgBox ("Completed")

    Sheets("INSTRUCTION").Select

    Range("I1").Select

End Sub

Thank you in advance for the help.

Microsoft 365 and Office | Excel | For business | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Jim G 134K Reputation points MVP Volunteer Moderator
    2024-07-24T20:23:34+00:00

    Hi

    This page explains how to use File dialogs in Excel for Mac: https://macexcel.com/examples/filesandfolders/

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-07-24T14:07:33+00:00

    No similar libary for VBA for Mac.

    I guess you need rewrite it with other language e.g. PHP or Go language.

    Was this answer helpful?

    0 comments No comments