Macro Security - Excel VBA Programming Course: Lesson 5

Excel 10 tutorial
Excel 10 tutorial
4.5 هزار بار بازدید - 5 سال پیش - In this lesson I want
In this lesson I want to talk about Macro Security. Hello everyone. Welcome back to Excel VBA Programming Course. I'm your trainer KAZI and this is #Excel10Tutorial. So why do we need security in the first place? Well macros need access to parts of our windows like the file system to perform certain functionalities. For example VBA can be used to open an Excel file. In order to open an Excel file you need to be able to find it on the file system. So these permissions are a good thing for us developers but they have been exploited by malicious hackers in the past. In fact viruses have been packaged directly with an Excel macro files and they're particularly dangerous because the users do not necessarily need to run a macro for this virus to be spread. A macro can automatically start running in the background when a workbook opens which makes it a really dangerous way to distribute a virus. To solve this problem Microsoft introduced several security features way back in Excel 2007. Most importantly whenever the user opens a workbook that has macros they're going to be prompted with a yellow notification bar by default. That bar says hey this workbook has macros do you want to enable them. Until you enable it, it's going to prohibit any of them from running. So the user kind of has this wall where they have to confirm that they trust the workbook to permit the macros to run. So where is this security option actually configured? Well if we go to the developer tab and click on macro security we're going to get this trust center dialog box. And under macro settings this is actually configured. We have four total options available to us here. The standard default one is “Disable all macros with notification” and that's exactly what we see typically. All macros are disabled but the user is notified. By clicking “Enable Content” the macros are enabled. The option above is “disable all macros without notification”. That means that all macros will be completely prohibited from running. The user is not even going to get a notification. This option is not for us because then we won't be able to execute our macro. The third option here, we have, “Disable all macros except digitally sign macros”. Now this feature is designed for advanced people or developers who rather like to sell their code or a plug in that add additional functionality to excel. They register an account with Microsoft and provide a token of authenticity; whenever you open their plugin or program the Microsoft confirms that the code is authentic through this digital signature. This option is a little bit more complex for us and we won't need it as well. Finally the fourth option here is to “Enable all macros” and in parentheses, it says “not recommended potentially dangerous code can run”. So this is very dangerous and we won’t use it. So this default option disable all macros with notification is what we're actually going to be keeping throughout the course. There's just one problem, it's just very annoying. Whenever you open a workbook you're going to be greeted with this yellow notification bar. So what we're looking for is an option that maintains the security setting in such way so that we get notification for unfamiliar workbook but we also want to ensure that we don't see the security notification bar for our own files or the files that we trust. How can we do that? The way we do that is with a feature called the Trusted Locations it's available at the second tab right in the trust center. Trusted location is a folder on your computer that we label as safe. Any macro workbooks that we put in these locations will be trusted and when we open them it's not going to give us this security warning. So how can we set this up? Just click on “Add new location” then browse and select the folder you want to mark as safe. And there's one more thing I want to check mark this box which is “sub folders of this location are also trusted”. If we don't check the box that means only Excel files at the top level within the actual folder are going to be the ones that are trusted. We want to make sure that everything is covered no matter how many layers down we go. And this option will ensure that happens for us. So once that's selected we can click OK. That's all there is to cover here and the next lesson we'll be learning “The Macro Recorder”. See you there. Now if you missed any lesson of this Excel VBA programming course check this playlist: bit.ly/excelvbacourse Subscribe the channel for upcoming videos: goo.gl/uL8fqQ Support the channel with as low as $1 www.patreon.com/excel10tutorial #vbacourse #macro Playlists: Excel VBA Programming Course: bit.ly/excelvbacourse Advance Excel Tutorial: goo.gl/ExYy7v Excel Tutorial for Beginners: goo.gl/UDrDcA Social media: Facebook: facebook.com/excel10tutorial Twitter: twitter.com/excel10tutorial
5 سال پیش در تاریخ 1398/02/09 منتشر شده است.
4,581 بـار بازدید شده
... بیشتر