Mar 03 2021 04:56 PM
Hi guys
The code I wrote under is the one I used when I had Windows but recently I changed to Mac. I want to change the code so it runs on Mac but don't know what needs to be changed since this is my first time and I didn't find any information on internet. I hope if anyone could give some feedback.
If Range("F3").Value = "" Then
Windows("Import OT.xlsm").Activate
Sheets("Cash").Select
Dim filename102 As String
Dim path102 As String
Application.DisplayAlerts = False
path102 = Environ("UserProfile") & "\Dropbox\A271\5 Oppgjor\" & 2021 & "\"
filename102 = Range("B1").Value & ".xlsx"
ActiveWorkbook.SaveAs path102 & Range("A2") & "\" & Range("A1") & " " & filename102, xlOpenXMLWorkbook
Application.DisplayAlerts = True
Else
Cells.Select
Range("F3").Activate
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Dim Path2 As String
Dim fpathname2 As String
Path2 = Environ("UserProfile") & "\Dropbox\A271\4 Lonnslipper\"
fpathname2 = Path2 & Range("F3") & "\" & Range("F2") & " " & Range("B3") & ".xlsx"
ActiveWorkbook.SaveAs filename:=fpathname2, FileFormat:=51
ActiveWorkbook.Close
Thanks :)
Mar 04 2021 12:40 AM
Maybe this information will help you.
Nikolino
The more I know, the more I realize that I don't know anything.
(Albert Einstein freely based on Socrates)
Mar 04 2021 01:05 AM
@excelnoob298 Folder paths on the Mac use forward slashes. Try recording a macro on the Mac, that opens and closes a file on your. Then you'll see how it works on a Mac. Now, re-write your "path" statements to match that format.
Mar 04 2021 07:40 AM
Mar 04 2021 09:27 AM