Excel Save workbook failing

Hi,
I have an .xlsx file in Excel application scope. Doing some hot key operations to copy code form notepad to the VBA editor window and to run the code. And I do the Save work book. Save work book failing. Can you please suggest what is going wring. This code used to work before.

Thank you,

@A_Learner

Share screenshot of excel application scope’s property.

Regards,
Ajay Mishra

Hi @A_Learner

Instead of using the classic activities use the modern activities to run the vb code in xlsx file.
Follow the below steps -
→ Insert the Excel Process scope activity and insert the Use excel file activity inside of it.
→ Inside Use excel file activity insert the Invoke VBA Activity.
→ Keep the VB Code in the notepad file and copy the path of the notepad file.
→ Give the path of the notepad file in the Code file path field.
→ Give the Method name in the Entry method name field.

This will work with out opening the editor window and copying the code. The above will work fine.

Check the below image for better understanding,

Hope it helps!!

1 Like

Please help me understand what is the difference and how it is going to fix the issue.

Thank you,

hi @A_Learner ,

As @Ajay_Mishra suggested, please share screenshot and/or error messages so we can help you better.

Excel Application Scope
Send hotkey ALT+F8 to open vba
Type into the vba file name
Click Create
send hot key ctrl + a
send hot key delete
Using hot keys copy from vba file all content and paste in vba editor
send hot key f5 to execute vba
SAVE workbook (erroring)
Copy work book to another workbook

Repeat the above steps for all the vba files.
For the first vba code file, SAVE work book working fine.
From the second time, SAVE workbook erroring.

Do I need to separate Excel Scope to each of the vba files?

Thank you,

The reason for doing from UI is that VBA running is disabled for security. Thank you.

That would be better idea as this will not occupy memory while running the bot .

Thanks,
Ashok :slight_smile: