Posts by Shazra626

    Hi,


    I tried this code with 64 bit excel and it doesn't run. It gives me below error code.


    "The code in this project must be updated for use on 64-bit systems.
    Please review and update Declare statements and then mark them with the PtrSafe attribute."


    Also the following code is highlighted in Red while pasted on a fresh module.


    Code
    Private Declare Function SwitchDesktop Lib "user32"(ByVal hDesktop As Long) As Long
    Private Declare Function OpenDesktop Lib "user32" Alias "OpenDesktopA" (ByVal lpszDesktop As String, ByVal dwFlags As Long, ByVal fInherit As Long, ByVal dwDesiredAccess As Long) As Long
    Private Declare Function CloseDesktop Lib "user32" (ByVal hDesktop As Long) As Long


    Note: I am running on Windows 10 64-bit operating system