troubleshooting Question

Auto enable macros (workbook code)

Avatar of vartanu
vartanu asked on
Visual Basic ClassicMicrosoft Excel
1 Comment1 Solution1894 ViewsLast Modified:
Hello to all,
I'm using a VB code in 100 excel files(in one folder).
This code will save a back up copy everytime the data is change.
Can I somehow autoenable macros, so I wont get everytime the promt  "enable macros or not"
The code is embebd in the "view code" of each workbook.
Each workbook contain a table.
My code right now looks like this:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
z = Left(ActiveWorkbook.Name, Application.WorksheetFunction.Find(".", ActiveWorkbook.Name) - 1)
XPath = "P:\starpro\Plateau 1\11 Table Upload\System Static Data\Functional Design\FS Bak\Tables Bak\" & ActiveWorkbook.Name & Format(Now(), "dd-mm-yy hhmm") & ".xls"
ActiveWorkbook.SaveAs (XPath)
End Sub
I'm just a beginer with VB so please be kind.
Thank you very much in advance.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros