PDA

View Full Version : Trouble switching to the M1 Mac or Excel in Office16.54



jvbeaupre
12-17-2021, 11:41 AM
I just switched to the new Mac (M1 iMac 24", running the latest system) and updated excell to the most recent version 16.54.
Most of my code no longer runs.
It's mystifying that something so simple as the following bombs with an overrun at the end of the loop.
Has anyone else experienced similar difficulties?


Sub a_test_digammad()

For z1 = 1 To 4.01 Step 0.1
Debug.Print z1, diGammad(z1)
Debug.Print "---"
Next z1
End Sub

Function diGammad(x)
diGammad = x
End Function

Paul_Hossler
12-17-2021, 01:02 PM
Win 10, Office 365

All I did was use Option Explicit and Dim z1 as a Double

Possibly (bold, underlined) not Dim-ing it on a Mac it'd be a variant and that might cause an issue

29235



Option Explicit


Sub a_test_digammad()
Dim z1 As Double


For z1 = 1 To 4.01 Step 0.1
Debug.Print z1, diGammad(z1)
Next z1
End Sub


Function diGammad(x)
diGammad = x
End Function

jvbeaupre
12-17-2021, 01:32 PM
That's encouraging.
I'll try that

jvbeaupre
12-18-2021, 04:55 AM
That's encouraging.
I'll try that

I did try that, but the same problem occurs.
The problem seems deeper and related to 32-bit vs 64-bit implementations of VBA7.
(https://docs.microsoft.com/en-us/office/vba/language/concepts/getting-started/64-bit-visual-basic-for-applications-overview)
I read the above reference think it's related, but I really don't know how to proceed.

I'd be very interested in hearing from Mac M1 users of Excel VBA.

Thanks,
Jim

jvbeaupre
12-21-2021, 06:27 AM
UPDATE: The problem doesn't occur when I step through the code {CMD SHFT I}. That being said, that's not a solution, only a clue.

georgiboy
12-21-2021, 09:02 AM
Have you tried to dim z1 as a variant instead of a double in the same code?

jvbeaupre
12-21-2021, 09:15 AM
Have you tried to dim z1 as a variant instead of a double in the same code?

I've tried option explicit, variant, double and various combinations. The result is the same Runtime error 6 at the end of the z1 loop.

jvbeaupre
12-29-2021, 02:33 PM
More info:
The problem occurs when there is a debug.print statement in a loop

jvbeaupre
12-30-2021, 03:30 PM
It also occurs when debug.print is in NOT in a loop, but not always.

jvbeaupre
01-23-2022, 01:15 PM
Problem is fixed in Excel 16.57