Hi NavinAgrawal1,
Sorry if the attachment did not come through at first. I was able to see it now.
For this issue, please be informed that all Declare Statements must now include the PtrSafe keyword when running in 64-bit versions of Microsoft Office. The PtrSafe keyword indicates a Declare statement is safe to run in 64-bit versions of Microsoft Office.
Please declare the PtrSafe keyword to your statements, check the link below for guidance.
https://docs.microsoft.com/en-us/office/vba/lan...
For more details, please see: https://docs.microsoft.com/en-us/office/vba/lan...
I hope it worked out well for you. If not, please reply back to this forum to let me know. I will be glad to follow up and help you further.
Regards,
John