Forum Discussion
excelnoob298
Mar 04, 2021Copper Contributor
How can I write this windows code into Mac code? (VBA)
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 ...
excelnoob298
Mar 04, 2021Copper Contributor
I tried this method but there was to much code to write for what I have over. but it seems to work maybe on Mac. I encountered another problem if you could help with it 🙂
Path001 = Environ("UserProfile") & "\Dropbox\A271\4 Lonnslipper\" & Range("F3")
Folder = Dir(Path001, vbDirectory)
If Folder = vbNullString Then
VBA.FileSystem.MkDir (Path001)
ActiveWorkbook.SaveAs filename:=fpathname1, FileFormat:=51
ActiveWorkbook.Close
Else
ActiveWorkbook.SaveAs filename:=fpathname1, FileFormat:=51
ActiveWorkbook.Close
End If
the code works for finding if a folder exists or not and then based on this create or not.
This code works fine on windows but on Mac I get error message on this part "VBA.FileSystem.MkDir (Path001)". I checked the link you sent but the code there was to long. if I have to write that code for every sheet I have then that would take me few days to fix. so I was wondering if you could point out what I have to edit here for it to work on Mac vba
thanks 🙂
Path001 = Environ("UserProfile") & "\Dropbox\A271\4 Lonnslipper\" & Range("F3")
Folder = Dir(Path001, vbDirectory)
If Folder = vbNullString Then
VBA.FileSystem.MkDir (Path001)
ActiveWorkbook.SaveAs filename:=fpathname1, FileFormat:=51
ActiveWorkbook.Close
Else
ActiveWorkbook.SaveAs filename:=fpathname1, FileFormat:=51
ActiveWorkbook.Close
End If
the code works for finding if a folder exists or not and then based on this create or not.
This code works fine on windows but on Mac I get error message on this part "VBA.FileSystem.MkDir (Path001)". I checked the link you sent but the code there was to long. if I have to write that code for every sheet I have then that would take me few days to fix. so I was wondering if you could point out what I have to edit here for it to work on Mac vba
thanks 🙂
NikolinoDE
Mar 04, 2021Gold Contributor
Regarding Mac, unfortunately, I can't help. A beginner is a pro compared to me.
Sorry that I can't help you, but I'm sure that some of the great people and specialists here will take care of your issue.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)
Sorry that I can't help you, but I'm sure that some of the great people and specialists here will take care of your issue.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)