VBA macro doesn't work on my Mac

damav78

New Member
Joined
Sep 29, 2024
Messages
39
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
Hi I am using an excel file running a vba macro. The macro code works fine on my windows pc but it doesn't work on my Mac although I have enable all macros from excel preferences.
Anyone could help??
Thank you
 
There are 4 main types of module a regular module where the majority of code goes, a worksheet module (where this code should go), a Workbook module and a Class module. Please note the way this is written seems very abrupt for a legitimate question by someone who is trying to help you.

If you have transferred it from iCloud then your macro's might be blocked on the file and might have triggered the "Errors were detected while saving" message, if you transferred from a desktop with a memory stick then it is unlikely to get blocked.

Then try copying and pasting the code (preferably via a text file) from the file on the Windows machine into the Sheet code window and test (btw this answers the question I asked about which module the code is in) and test.
Then reply to this post with what issues it shows.
First of all thank you very much for your help. My English language are basic and I am sorry if the way I wrote my answer seemed rude. I didn't have this intention in any case.
Whichever way I choose to download the file (because the original file is at my office pc)... via iCloud or via anydesk file transfer the result is the same. No file has the code written inside. Tomorrow I will try to copy it to my flash drive and see what will happen. But generally speaking it doesn't sound very normal to me. First of all.. it is very strange iCloud to block the code without popping any warning message and the same thing happens to any anydesk file transfer also. But I'll give it a try tomorrow and I will let you know.
I have try to copy and paste the code from txt file on my windows pc to my Mac and I still got the same error message I wrote before.

"Errors were detected while saving '/Users/User/Desktop/Filename.xlsm'. Microsoft Excel may be able to save the file by removing or repairing some features. To make the repairs in a new file, click Continue. To cancel saving the file, click Cancel."

if I choose continue it pops up this error message:
"Excel encountered errors during save. However, Excel was able to minimally save your file to /Users/username/Library/Containers/com.microsoft.Excel/Data/Library/Application Support/Microsoft/XL0000FABD.xlsb."

Of course the file that creates in there its not ok... and also has no code in it.
Is there any way that the problem has to do with my Mac excel?

Thank you
 
Upvote 0
Copy the code from your windows machine, paste it in a text file, put that on your flash drive then copy/paste that code directly into the worksheet code window on the file that is already on your Mac, obviously check that your security settings enable macro's to run then test to see if the code runs

it is very strange iCloud to block the code without popping any warning message
It is not iCloud that would block it, it would be the operating systems security (you'll get the same with Windows if you download a file containing macro's from the net or even from an email, you need to unblock it or put the file in a trusted location [you do get a warning though that the file isn't trusted below the ribbon]).

I would have to test at work if Mac's behave in the same way as I transfer files at work between the 2 on a flash drive.
 
Upvote 0
Copy the code from your windows machine, paste it in a text file, put that on your flash drive then copy/paste that code directly into the worksheet code window on the file that is already on your Mac, obviously check that your security settings enable macro's to run then test to see if the code runs


It is not iCloud that would block it, it would be the operating systems security (you'll get the same with Windows if you download a file containing macro's from the net or even from an email, you need to unblock it or put the file in a trusted location [you do get a warning though that the file isn't trusted below the ribbon]).

I would have to test at work if Mac's behave in the same way as I transfer files at work between the 2 on a flash drive.
Ok. I get it. I will also try it tomorrow and I will let you know.
Thank you very much and excuse me for one more time
 
Upvote 0

Forum statistics

Threads
1,226,798
Messages
6,193,062
Members
453,773
Latest member
bclever07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top