Zulfiqar Dholkawala
Zulfiqar Dholkawala

Reputation: 478

Error while running VBS script

I am trying to run excel macro using VBS and getting attached error. Is there a way to enable macro at the run time? if so, how?

enter image description here

Upvotes: 1

Views: 295

Answers (1)

Vityata
Vityata

Reputation: 43595

This should be done in Excel itself:

  • Click the File tab and then click Options.
  • Click the Trust Center tab and then click the Trust Center Settings button.
  • Click "Enable all macros" Note - it is not recommended for a reason to do so!
  • Set the checkbox to "Trust access to the VBA project object model"

enter image description here

Upvotes: 2

Related Questions