Consulting

Results 1 to 10 of 10

Thread: Trouble switching to the M1 Mac or Excel in Office16.54

  1. #1

    Trouble switching to the M1 Mac or Excel in Office16.54

    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
    Last edited by Paul_Hossler; 12-17-2021 at 01:00 PM.

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    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

    Capture.JPG

    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
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    That's encouraging.
    I'll try that

  4. #4
    Quote Originally Posted by jvbeaupre View Post
    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/off...tions-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

  5. #5
    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.

  6. #6
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,192
    Location
    Have you tried to dim z1 as a variant instead of a double in the same code?
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved

    Excel 365, Version 2403, Build 17425.20146

  7. #7
    Quote Originally Posted by georgiboy View Post
    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.

  8. #8
    More info:
    The problem occurs when there is a debug.print statement in a loop

  9. #9
    It also occurs when debug.print is in NOT in a loop, but not always.

  10. #10
    Problem is fixed in Excel 16.57

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •