BACKGROUND:
As some of you already know, I am seeking knowledge on Application properties. (Specifically I want to know:)
- Which values are read-only or not?
- Of the values that are not read-only, which changes are reset by Excel?
- Of those values reset by Excel - WHEN are they reset? (i.e. at sub end, at workbook close, at application close)
I have raised the question as to whether there is any webpage somewhere out there which has a summary of the lifetime of changes made to the Application Properties (see: http://www.excelforum.com/excel-prog...roperties.html) however so far there has been no result.
THE CODE SO FAR:
In the meantime, I thought I would create code that would report on the values of Application Properties. Having done this, I set out to create a macro that would compare two of these reports. (If anyone reading this is familiar with a program called regshot - you will instantly know where I got the idea and what I am trying to achieve.) This would enable someone to run/save a report, create a dummy sub to change some of these values and then run/save a second report. The comparision macro will enable to see which values have been reset by comparing the results of the 'before' and 'after' report.
And it appears to be working. See workbook attached. (Please excuse messy code in comparison macro. Also this is intended to be a XLAM however I posted it here as a XLSM to make it more accessible).
Now the problem (as stated in the thread title) is this: I need a macro to automate this testing process. And I have no idea of how to begin.(I'm a VBA rookie. Please be patient!)
COULD SOMEONE PLEASE PROVIDE THE FOLLOWING CODE:
I need an "automated tester" macro. It would need to:
- run a first (before) report
- change the values of all the properties (the alternative values would probably need to be tested beforehand to ensure that they really are valid values for that property)
- run the second (after) report
- compare the two reports
Steps 1, 3 & 4 are already created. It would be just a matter of calling these from the "automated tester" code.
The tricky bit (as I see it) will be 1. determining the alternative values for each property in Step 2 and 2. testing whether these values are reset at sub end/WB close/App close.
Changing the values could be called from a separate sub so doing that would automatically test the first possibility (reset at sub end).
Bookmarks