Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Need help taming the DTPicker control in Excel 2010

$
0
0

I've created a workbook application in Excel 2010 (32 bit). 

The application loads data from another workbook, which has an arbitrary number of rows of date-time stamped data in an arbitrary number of columns.  On one sheet I have DTPicker controls for the start date and the end date of the range of data it will use to generate charts and summary tables via macros.

Everything works fine on my computer, but when I deploy it to users the code breaks the first time it tries to interact with the DTPicker controls.  All the data loads in fine, but when it tries to use the extremes of the data range to set the mindate and maxdate properties of the DTPicker, it fails.  The extremes are date-time values; problem seems to be accessing the control.

Tests on another machine indicate that the control can be selected, and the name in the formula bar matches what I have on my development PC.  But the space inside the control looks like a garbled image instead of a date in a dropdown, and when the user tries to access the properties of the control in design mode, the worksheet properties appear instead.

The garbled image appeared to be an issue on my PC at first as well, if the file was saved and reopened. That was addressed using a suggestion from another developer that opening and closing another file (for some unknown reason) after the workbook was opened would eliminate the problem (which it did on the development PC).

I am looking for a solution that provides a familiar calendar pop-up and constrains date selection to the range included in the current data set (which also may get overwritten during use, with corresponding reset of the limits).

I would like the solution to be portable such that user don't need to register controls or do anything other than open the workbook and run built-in macros. I believe most of the users will have a version of Excel that matches the development PC's, but I may also need a version checker and code branches that provide the correct functionality using the method applicable to their version. If there are certain versions that the DTPicker control will not work with, I need to know so that I can include that information in the instructions or error handler messages.

Can this be accomplished using the DTPicker control? Or is there a "best" workaround using alternate controls that can be explicitly defined via a userform and underlying code, which activate when the user hovers over or clicks on a date control?


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>