I wrote an excel VBA macro that works with checkboxes. To check whether the checkbox is selected or not I use the following code:
Sheet4.Shapes("dietary").OLEFormat.Object.Value
This works well on a windows PC; however, a colleague uses a mac and there it produces an error.
How can I use the checkboxes in a way that is compatible with windows and mac?
The problem is not with the Checkbox. It is with the way you are referencing the sheet :)
Codenames sometimes give a problem in Excel 2011
Try this
ThisWorkbook.Sheets("Sheet4").Shapes("dietary").OLEFormat.Object.Value
Example (Depicting Both Scenarios)
Now removing the CodeName