Using VBA To Lock The PC

Ever needed or wanted to be able to lock the PC? Perhaps after running your code?

Well it is surprisingly simple to do!

Luckily for us, there is a simple API we can implement to do all the heavy lifting. All we need to do is build a simple wrapper function around it as demonstrated below:

Continue reading

Modern Web Browser Control Disappearing Control Source Bug

Software Bug

Came across a really weird bug today while trying to identify another bug with the Microsoft Access Modern Web Browser control.

I set a Modern Web Browser control’s Control Source to something like:

="https://" & [URL2]

then tested and came back into Design View to see some messed up Control Source shown on the control itself, yet a blank property value. I even tried the Zoom box, and it too is blank???!

Continue reading

How to Expand All the Microsoft Roadmap Items

Roadmap with markers

If you’ve ever seen any of my posts about the Microsoft Roadmaps, I typically provided a screenshot showing all the items expanded. For instance, in my post:

or

Continue reading

Modern Web Browser Control Initially Displaying Blank Page

Software Bug

Yep, another bug with the Modern Web Browser control.

Worse, this issue occurs when simply trying to navigate to a URL via VBA using the form’s current event. At the opening of a form, navigation is simply completely unreliable and more often than not renders a blank page! Sometimes it works, but most of the time it does not! When navigating the records, the event works just fine, this bug is limited to the initial opening/loading of the form/report control. So in most instances, the user ends up with a blank Modern Web Browser control when they should be seeing content.

Continue reading

Modern Web Browser Control Leaving Hidden Processes

Microsoft Access - Modern Web Browser control

Just a quick FYI regarding the Modern Web Browser control. I’ve been doing some recent work and have been experiencing issues.

As previously reported, I’ve been getting blank displays even though the URL indicates it went to the site, nothing new here!

Now, after closing my database, I kept having a lock file that wouldn’t go away and I couldn’t delete it. Examining the Task Manager I came to see that Access remained running as a hidden process, and I also then saw a whole bunch of Microsoft Edge WebView2 processes running as well. It was only after killing all of these that I was able to finally delete the lock file and continue working.

Continue reading

Smart Indenter Is Alive

One of my preferred add-ins for VBA development for many years was a small little indenting utility called Smart Indenter. It did one thing, automatically indent code to make it much more legible, but it did it well!

It has always been part of my add-ins page because it was so good:

Sadly, it seemed the product was abandoned by its’ developer some time around when Office 2007/x64 surfaced.

Over the years, I have seen people reporting various hacks to make the older version work with newer versions of office (I report a solution that worked for me), but others report those same hacks not solving the issue for them.  So it was a little luck of the draw if you could get it working.  I had a few posts on this as well:

Continue reading

How To Determine If A Font Exists

Going through some old code of mine, and thought I’d share a simple function that can be used to determine if a font is installed, or not.

I’ve previously published a function which employed Word Automation to do the exact same thing:

but the following approach is better IMHO and doesn’t require starting up another Office application.

Continue reading