Excel – Protect/Unprotect WorkSheet(s)

As I mentioned, in my last post, I’ve been doing Excel development recently, so I thought I’d post a few procedures, to spread the wealth as they say. Most of these I created quite a few years ago for other projects that I revamped for this newest project.

This post is about Protecting and Unprotecting a worksheet or all the Worksheets in a workbook.

Protect/UnProtect All the Worksheets

Below are 2 procedures that loop through all the worksheets within a workbook and Protect/UnProtect them all using the same password.
Continue reading

Excel – Reset / Empty Comboboxes

I’ve been doing a lot of Excel development to create several very advanced WorkSheet forms for data entry.

I’ve experienced some serious issues trying to use Data Validation in which Excel crashes randomly when the feature is used (and yes I tried an Office repair, and yes I tried it in Excel 2013 and 2016, …). Since I cannot deliver such an unstable product to my clients, I ended up switching over to using ActiveX Combo boxes.

Now, all that said, if you have a form, any form, you are going to need some sort of Reset button. Now you can reset each combo box individually by doing something along the lines of:

ActiveWorkbook.Worksheets("TimeSheet").YourComboBoxName.value = ""

but then if your design evolves, then you have to recode and that can becomes very tedious, time consuming and prone to mistakes and oversights!

Anyways, long story short, I wanted a simple function that would loop through all the combo boxes on a sheet and reset them all. I didn’t want to have know their names, how many of them existed, … I just wanted a function to handle it all. Below is the procedure I came up with.

Continue reading

Access – Bug – Maximizing a Hidden Form Unhides It

Software Bug

Well, I’ll admit it is a very particular situation, but I’ve found yet another bug.

I had a specific need to open a form hidden to the user and then maximize it, so I made a call such as

DoCmd.OpenForm "frm_Db_Util_GetInfo", acNormal, , , , acHidden

and then in the form’s Open or Load event I inserted a maximize command, like

DoCmd.Maximize

and low and behold the hidden form was no longer hidden?!

I’ve tried implementing a variety of suggestion from fellow MVPs without much success (but I still have a few left to test, fingers crossed). Should I ever find a workaround, I will post back and share with all.

And yes, I did notify the Access Dev Team.

CCleaner Security Notification

If you have installed and/or use CCleaner be sure to read about a serious security issue. Learn all the details by viewing the notification directly from Piriform’s website (link to the article provided below).

Security Notification for CCleaner v5.33.6162 and CCleaner Cloud v1.07.3191 for 32-bit Windows users

Be sure to share this notice as CCleaner is used everywhere!

More resources on the subject

Access – Bug – AWA Queries only returning 50 records

Software Bug

A new bug has surfaced impacting Microsoft Access Web Applications (AWAs) in which queries only return the first 50-60 records. This is has been confirmed by multiple sources now.

The good news, well sort of, is that fellow MVP George Hepworth found a simple workaround to the problem which is to simply apply a sort. Once you get the query results, apply a ascending or descending sort and all the records show. I know it’s not ideal, but for now, it will have to do until Microsoft fixes whatever it is that they’ve broken.

The original MSDN thread can be found at Access web app queries now being throttled to first 50 records only?

Office 365 Day – 2017

Are you using Office365? Then be sure to check out the FREE Office 365 Day in Colorado Springs, CO. Did I mention it’s FREE! Learn from industry leaders and local experts and network with like-minded professionals & students. A great opportunity for users/developers of all levels. To learn more, checkout

http://www.office365day.org/

Access Form Resizing Based on Screen Resolution

Here’s another question we see ever so often in the discussion forums.

As technology has advanced, screen resolution continues to grow making existing forms no longer acceptable to work with.  So what can be done about it?  How can we distribute a database so that it work on any PC with varying screen resolutions?

I first faced this issue myself about 10 years ago.  After developing a complex database for one of my client’s and having it in production for about 2 years, they decided to include a new department in its usage, problem being they all used laptops with smaller screens.  My database had been developed for one department and their screens and now ported onto this new department’s laptops, my forms no longer fit nicely within the monitor and users needed to continuously scroll.  Not acceptable!

Continue reading

Special Characters and Internationalization of an Application

The Problem

If ever you get into developing applications, especially Access databases, that are deployed on various countries and/or where users change the default Regional settings you will quickly ask yourself why, oh why, did Microsoft make things so complex.

For example creating a value list through VBA, some languages use a comma (,), others the semicolon (;) and so on, and so on it goes for decimal separators, date separators, …

So hard coding the separator is a no-no unless you are in a very controlled environment!

Let’s look at a simple example, such as getting a listing of all the tables within a database to be used as a Value list of a combo box. Normally, our code would look something like:

Continue reading

MSCOMCTL.OCX Bug (Treeview, ListView, …)

Software Bug

Just a heads up that there are now numerous reports that the most recent update impacting the MSCOMCTL.OCX actually breaks TreeView, ListViews et al.

First and foremost, Microsoft was advised of the issue and we are all waiting for them to release and update to fix the faulty update.

Continue reading