Alex & Access

November 30, 2015

How to automate entering VBA password

Filed under: VBA — access @ 11:56 am

VBA project password can’t be considered as strong protection, but sometimes you have to use it. Unprotecting VBA Project Password article shows a sample code to unprotect project, if you know the password. Same technique can be useful when you need to interact with other programs, which you can’t automate with OLE or any other interface.

AzlJ6

February 20, 2015

Using WMI

Filed under: VBA — access @ 8:14 am

Normally we are using Windows API to access registry, etc. You can a lot of tasks with WMI. The main advantage, as I see, that WMI code works with any Windows version, also 32 and 64 bit, so you don’t need to use conditional compilation. Hope it will work on future Windows versions as well…

Here a lot of sample code on how to use WMI for different tasks:

WMI Tasks for Scripts and Applications

January 28, 2015

Getting localized NT AUTHORITY domain name

Filed under: VBA — access @ 10:13 am

If you are dealing with built-in system accounts, like NT AUTHORITY\SYSTEM, this code can help you on localized Windows versions, where NT AUTHORITY domain is also translated, for example to NT-AUTORITÄT in German version. You can get localized name using it SID "S-1-5-18":

?GetObject("winmgmts:root\cimv2").Get("Win32_SID.SID=’S-1-5-18’").ReferencedDomainName

You have to use this function, when you select system object using Object selection dialog as well.

January 27, 2015

Object selection dialog

Filed under: VBA — access @ 9:51 am

Object selection dialog (or Directory service Object Picker) can be useful when you need to change user right on file system or SQL server. I never used it before and it took me some time to find the right code, which works in Access and VB – Object picker with dispcallfunc.

image

Using the Windows 2000/XP Object Selection Dialog article helps to understand parameters of dialog, and Active-Directory-Object-Picker is a .Net version of dialog.

January 5, 2015

Automate any browser with Selenium VBA

Filed under: VBA — access @ 8:23 am

You can easy use Internet Explorer to do web tasks from your code, like screen-scraping or filling forms. But other browsers do not have COM interface, so Selenium VBA let you do such tasks with other browsers as well. Basically it provides a COM interface to the popular Selenium web testing tool. What you can do with Selenium VBA:

  • Automate repetitive web browser tasks.
  • Quickly fill a web form multiple times with data from your table.
  • Extract data from a web page into custom table.
  • Take screenshots of a Web site and save them in a PDF file.
  • Use the selenium automation framework .

Blog at WordPress.com.