Can anyone help me convert this to work with 64 bit excel? I found the following thread: https://www.excelforum.com/excel-pro...-workbook.html there's a file that has an event handler I would like to make work for me.

I have an excel workbook that I have written some vba modules/userform code for. I have explicitly defined the workbook name at the start of the program but during the processing of the userform when clicking save, if I click another workbook, the new workbook becomes focused. The code suggests that the coded workbook should be the focus for the code, but it is not. I'm pretty savy with vba but have never worked with event handlers. Can someone help?

Here's how I explicitly defined the workbook at the first line of code initializing the userform:
wbname = ThisWorkbook.Name
Set wb = Excel.workbooks(wbname)

If i inspect the wb.worksheets.... line when the code errors due to the click on the new workbook during an update/module run to save data to the workbook, the correct workbook name and path is shown.