pedrinhogui
New Member
- Joined
- Jun 29, 2020
- Messages
- 4
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
- MacOS
Hello friends,
Hope you guys are doing well!
I do have a beautiful code working for that , HOWEVER only running on WINDOWS and my Boss now has migrated all computers to MacBooks. Anyway, over the past 2 days I did some research looking for it, and I could not find nothing that actually works or it's even close to... So would some kind soul in here have a code that actually works on office for Macs? The office being used it's a Office 365, so everything it's up to date!
What do I need?
A code that works in a similar way of the code posted below, but that it's compatible with Macs ( code that allows user to look for the file on the computer, select it and import the file to the workbook).
Does anyone can help me please?
Thank you very much for your time!!!
Hope you guys are doing well!
I do have a beautiful code working for that , HOWEVER only running on WINDOWS and my Boss now has migrated all computers to MacBooks. Anyway, over the past 2 days I did some research looking for it, and I could not find nothing that actually works or it's even close to... So would some kind soul in here have a code that actually works on office for Macs? The office being used it's a Office 365, so everything it's up to date!
What do I need?
A code that works in a similar way of the code posted below, but that it's compatible with Macs ( code that allows user to look for the file on the computer, select it and import the file to the workbook).
Does anyone can help me please?
Thank you very much for your time!!!
VBA Code:
Sub Select_File_Or_Files_Windows()
Dim FileToImport As Variant
FileToImport = Application.GetOpenFilename(fileFilter:="CSV's (*.csv), *.csv", Title:="Select file to import")
If FileToImport <> False Then
With ActiveSheet.QueryTables _
.Add(Connection:="TEXT;" & FileToImport, Destination:=ActiveCell)
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End If
MsgBox "Update Completed!"