Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How does Personal Macro Workbook become personal.xls
I use Excel 2003 in Windows Vista.
Application.StartupPath & "\personal.xls" is hidden, holding VBA code. On closing Excel after changing code, I get the invitation: "Do you want to save the changes you made to the Personal Macro Workbook? If you click Yes, the macros will be available the next time you start Microsoft Office Excel." Occasionally, I instead get: "Do you want to save the changes you made to personal.xls?". This is because I UNINTENTIONALLY unhide the hidden file. The correction is easy - click Window/Hide. I would like to know how to detect the operation that unhides the file? I hope the answer to this question will be generally useful. -- Walter Briscoe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How does Personal Macro Workbook become personal.xls
I don't think there is specific event for this but you can try using
the WindowActivate event of the thisWorkbook object. Try putting this one in and see where it leads you: 1. in VBA navigate to ThisWorkbook object of the Personals.xls in the object explorer (left hand pane) 2. double click it to open its code on the right hand side 3. in the code body put this: Private Sub Workbook_WindowActivate(ByVal Wn As Window) MsgBox Me.Name & " just got activated!" End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How does Personal Macro Workbook become personal.xls
In message
..com of Mon, 29 Mar 2010 07:31:26 in microsoft.public.excel.programming , AB writes I don't think there is specific event for this but you can try using the WindowActivate event of the thisWorkbook object. Try putting this one in and see where it leads you: 1. in VBA navigate to ThisWorkbook object of the Personals.xls in the object explorer (left hand pane) 2. double click it to open its code on the right hand side 3. in the code body put this: Private Sub Workbook_WindowActivate(ByVal Wn As Window) MsgBox Me.Name & " just got activated!" End Sub Thank you, I have done so. 1) I opened Excel and used Alt F+C to close Book1. 2) I used Alt+F11 to open VBA. Code in the last module (Module2) of personal.xls opened in a single pane. 3) I used Ctrl+R to open "Project - VBAProject" in the left hand pane 4) I double-clicked "Microsoft Excel Objects" to expand it. 5) In that expansion, I double-clicked ThisWorkBook to open its code window in the right hand pane. 6) In that code window, I put Private Sub Workbook_WindowActivate(ByVal Wn As Window) MsgBox Me.Name & " just got activated!" End Sub 7) I double-clicked Module2 to open its code. 8) I closed "Project - VBAProject" by clicking its "X" to restore the single page view. 9) I used Ctrl+S to save personal.xls. 10) I checked the code is now in place. I will report any results. -- Walter Briscoe |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How does Personal Macro Workbook become personal.xls
In message of Tue, 30 Mar 2010
07:02:43 in microsoft.public.excel.programming, Walter Briscoe writes In message .com of Mon, 29 Mar 2010 07:31:26 in microsoft.public.excel.programming , AB writes I don't think there is specific event for this but you can try using the WindowActivate event of the thisWorkbook object. [snip] Thank you, I have done so. [snip] 10) I checked the code is now in place. I will report any results. The code detects the result of a sheet losing its hidden property, but is not sufficiently fine-grained to detect the operation which does it. I will leave the code in place as a guard and wait to become more competent in dealing with events. ;( Thanks, AB ;) -- Walter Briscoe |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How does Personal Macro Workbook become personal.xls
In message of Mon, 12 Apr 2010
12:21:13 in microsoft.public.excel.programming, Walter Briscoe writes In message of Tue, 30 Mar 2010 07:02:43 in microsoft.public.excel.programming, Walter Briscoe writes In message .com of Mon, 29 Mar 2010 07:31:26 in microsoft.public.excel.programming , AB writes I don't think there is specific event for this but you can try using the WindowActivate event of the thisWorkbook object. [snip] Thank you, I have done so. [snip] 10) I checked the code is now in place. I will report any results. The code detects the result of a sheet losing its hidden property, but is not sufficiently fine-grained to detect the operation which does it. I will leave the code in place as a guard and wait to become more competent in dealing with events. ;( Thanks, AB ;) I have done a little more on this. I reduced the number of sheets to 1 to simplify the problem. I am closer to finding the offending sequence of operations. It seems to be necessary (but not sufficient) to say "OK" to "This action will reset your project, proceed anyway?" and later save personal.xls within the VBE. (Excel sometimes loses its way and I do occasional manual saves of personal.xls to minimise that risk.) In Excel of personal.xls, Window\Hide and Window\Unhide write to Workbooks("personal.xls").Windows.Item(1).Visible. I would like to know how automatically to set a watch on that location. I have made the VBIDE visible. I can't find anything about the structure of watches in "Excel 2002 VBA". Perhaps I can run the Add Watch dialog. In any case, I reckon to set the watch in workbook event procedures in personal.xls. I hope to get there, but am happy to accept any help. ;) -- Walter Briscoe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Personal Macro Workbook | Excel Programming | |||
Personal Macro Workbook | Excel Discussion (Misc queries) | |||
Where is Personal Macro Workbook? | Excel Discussion (Misc queries) | |||
No Personal Macro Workbook? | Excel Programming | |||
Personal macro workbook and personal.xls | Excel Discussion (Misc queries) |