baitmaster
Well-known Member
- Joined
- Mar 12, 2009
- Messages
- 2,042
I've seen this question asked before, but have not yet found a useful answer.</SPAN>
</SPAN>
When closing a workbook containing a password-protected VBA module, and then exiting Excel, I'm receiving a pop-up message asking for the VBA Project password. This appears minimum 4 times, the most I’ve seen it so far is 29</SPAN></SPAN>
Microsoft's own help on the subject seems to think the issue is caused by something far more complex what I've encountered:</SPAN>
https://support.microsoft.com/en-us/kb/280454</SPAN>
I’ve managed to narrow my issue down, and can recreate it as follows:</SPAN></SPAN>
and a single formula in a cell =test()</SPAN></SPAN>
Message appears 8 times when Excel quits. The problem is therefore being caused by Application.caller, which I need in my code as my UDF bases its calculation on the cell which called it.</SPAN>
</SPAN>
Is there another way I can refer to the cell that contains the UDF, other than to use this code?
</SPAN></SPAN>
I don’t have Google Desktop, and no other files are open including PMW which has been moved out of XLStart for this test. I'm currently on Excel 2010
Cheers
Matt</SPAN></SPAN>
</SPAN>
When closing a workbook containing a password-protected VBA module, and then exiting Excel, I'm receiving a pop-up message asking for the VBA Project password. This appears minimum 4 times, the most I’ve seen it so far is 29</SPAN></SPAN>
Microsoft's own help on the subject seems to think the issue is caused by something far more complex what I've encountered:</SPAN>
https://support.microsoft.com/en-us/kb/280454</SPAN>
I’ve managed to narrow my issue down, and can recreate it as follows:</SPAN></SPAN>
- create and save a .xlsm file containing this code: </SPAN></SPAN>
Code:
Function test() As String
test = Application.Caller.Address
End Function
- Password protect the VBA module</SPAN></SPAN>
- Close the file and quit Excel</SPAN></SPAN>
- Reopen the file</SPAN></SPAN>
- In the immediate window type: application.calculatefull</SPAN></SPAN>
- Close again and quit Excel</SPAN></SPAN>
Message appears 8 times when Excel quits. The problem is therefore being caused by Application.caller, which I need in my code as my UDF bases its calculation on the cell which called it.</SPAN>
</SPAN>
Is there another way I can refer to the cell that contains the UDF, other than to use this code?
</SPAN></SPAN>
I don’t have Google Desktop, and no other files are open including PMW which has been moved out of XLStart for this test. I'm currently on Excel 2010
Cheers
Matt</SPAN></SPAN>