Date for VBA not working in Excel 2011?

后端 未结 1 481
萌比男神i
萌比男神i 2021-01-27 04:19

Here is my code, I am attempting, which works BTW on a PC, but not on a Mac, to run this code and have an excel sheet created, named, add a tab, change the color of said tabs, c

相关标签:
1条回答
  • 2021-01-27 04:56

    the MISSING references are what are causing the problems. Remove the checkmarks there, and the basic stuff like date will start working again. If those references are critical to the code you are running, you will have to search out the Mac equivalents

    More about references - normally resolving "Missing" fixes it, but, from here

    What you're describing is typical of corrupted references. This can be caused by a referenced file being a different version or in a different location between the machine on which the code was developed, and the client machines. Our company also tries to keep all the machines configured the same way, but I've found it's essentially impossible to manage.

    Open any code module (or open the Debug Window, using Ctrl-G, provided you haven't selected the "keep debug window on top" option). Select Tools | References from the menu bar. Examine all of the selected references.

    If any of the selected references have "MISSING:" in front of them, unselect them, and back out of the dialog. If you really need the reference(s) you just unselected (you can tell by doing a Compile All Modules), go back in and reselect them.

    If none have "MISSING:", select an additional reference at random, back out of the dialog, then go back in and unselect the reference you just added. If that doesn't solve the problem, try to unselect as many of the selected references as you can (Office may not let you unselect them all), back out of the dialog, then go back in and reselect the references you just unselected. (NOTE: write down what the references are before you delete them, because they'll be in a different order when you go back in)

    Yes, disambigulating as VBA.xxxx will work, since Excel no longer has to look through all of the references.

    0 讨论(0)
提交回复
热议问题