Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Microsoft Word _ Excel Vba Not Running

Posted by: Frank Situmorang Apr 23 2019, 06:51 PM

[attachment=90117:Runerrormessage_1.png]Hello anyone can tell me why my Macro VBA not running?

It stops in
Windows ("Book2.xlsx") .Active

While the Book2 is already opening.

Thank you



Posted by: Doug Steele Apr 23 2019, 07:23 PM

Just to make sure, you've posted this to the Microsoft Word forum. Did you mean to post it to the Microsoft Excel forum?

AFAIK, activating a worksheet doesn't automatically run code in it unless it's a routine that's meant to be run upon activation (such as Workbook_WindowActivate or Workbook_SheetActivate in the ThisWorkbook module.

Posted by: mediator_ram Apr 25 2019, 05:09 PM

You can use Thisworkbook.Activate method to activate the workbook.
So your book2 is opening for running it further you need to add further macros.