+ Reply to Thread
Results 1 to 20 of 20

Macros (VBA code) not firing after opening on Android.

  1. #1
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Macros (VBA code) not firing after opening on Android.

    Hi all. I have a .xlsm file that I have been using for years. Yesterday I opened it on my Android, through Google Drive, and noticed that the code wouldn't fire. No big deal; I half expected that. But then today I opened it on my PC and the code still won't fire. Somehow opening the file on Android must have messed something up.

    I have "Enable all macros" checked under Macro Setting in the Trust Center. I'm using Excel 2016.

    Any ideas? Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,531

    Re: Macros (VBA code) not firing after opening on Android.

    Neither Android nor IOS can execute VBA macros, so it's not surprising that the code didn't fire. That said, it's unlikely that's the reason your code won't run.

    Check if event handling is enabled.
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    I'm not seeing that setting. Where is it?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,531

    Re: Macros (VBA code) not firing after opening on Android.

    You'd need to go into the Immediate Window and type ?Application.EnableEvents and press Enter. If it comes back false, type Application.EnableEvents = True and press Enter.

  5. #5
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    It came back true.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,531

    Re: Macros (VBA code) not firing after opening on Android.

    That proves two things. Macros are enabled and event handling is enabled.

    Suggest you post the code and, ideally, a sample workbook.

  7. #7
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    It says "You are not allowed to post any kinds of links, images or videos until you post a few times."

  8. #8
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    I did notice that if I copy and paste the routine into a fresh workbook, it runs. Maybe I need to copy the entire workbook, piece by piece?

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,531

    Re: Macros (VBA code) not firing after opening on Android.

    You ARE allowed to upload workbooks.

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  10. #10
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    Ok, hopefully it's attached. There's only one sheet, Sheet1, and that's where the routine is. I removed all of the code except for one MsgBox alert. The code is supposed to run when any cell value changes.
    Attached Files Attached Files

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,531

    Re: Macros (VBA code) not firing after opening on Android.

    There is no code, that I can see, in this workbook.

  12. #12
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    I wish I could post a screen shot. When I open the file, I hit Alt+F11 to open the VBA editor, then I look at the project explorer, and double-click on Sheet1. The code is:

    Please Login or Register  to view this content.

  13. #13
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    6,084

    Re: Macros (VBA code) not firing after opening on Android.

    There is, as Trevor said, no code in the workbook you posted. (It also only has Sheet2, not Sheet1)
    Rory
    I drink, and I know things

  14. #14
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    That's very strange. I don't know why it's doing that. I'm just going to post the original file. This workbook is much bigger and more confusing, but if you just go into the Sheet1 code, you'll see an MsgBox command that's not getting run.
    Attached Files Attached Files

  15. #15
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    6,084

    Re: Macros (VBA code) not firing after opening on Android.

    Your workbook project appears to be corrupt to me. Most things look wrong in the project explorer - eg no names in brackets after the sheet code names.

  16. #16
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    Yes, opening on Android seems to have corrupted it. Should I just try to re-create the workbook by copying and pasting, piece-by-piece?

  17. #17
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    6,084

    Re: Macros (VBA code) not firing after opening on Android.

    You could export the code, then save the workbook as an xlsx file, then reimport the code and save as xlsm again. I'd also suggest using Form controls or shapes to run your macros, not activex controls.

  18. #18
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    Well thank you everyone for the help. I have been copying and pasting the important stuff and now I seem to have a working version. Lesson learned - never open a .xlsm file on Android!

  19. #19
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,531

    Re: Macros (VBA code) not firing after opening on Android.

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  20. #20
    Registered User
    Join Date
    05-25-2017
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    17

    Re: Macros (VBA code) not firing after opening on Android.

    I have upped your reputations as much as it will let me. I don't want to mark it as solved just yet because I'm still curious how it became corrupted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel macros, buttons for Android
    By kieranm105 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2019, 10:33 AM
  2. excel vba code library android
    By emn123 in forum Access Tables & Databases
    Replies: 1
    Last Post: 04-25-2019, 03:32 AM
  3. Firing preview mode on opening
    By Saintor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2016, 06:04 PM
  4. Firing a Code while scrolling
    By davidpierce in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2015, 12:08 PM
  5. Workbook_Open code not firing unless MsgBox is in code
    By yay_excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2013, 03:11 PM
  6. Excel with macros on android tablet or ipad
    By Kobraz in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 07-01-2013, 04:58 AM
  7. Replies: 3
    Last Post: 11-10-2007, 03:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1