the code in this project must be updated for use on 64-bit systems

I need someone to help me rewrite the code below as insstructed in the google search results for this issue

https://www.google.com/search?q=the+code+in+this+project+must+be+updated+for+use+on+64-bit+systems&oq=the+code+in+this+project+must+be+updated+for+use+on+64-bit+systems&aqs=chrome..69i57j0l5.728j0j9&sourceid=chrome&es_sm=0&ie=UTF-8

offending code

Option Explicit

' ----------------------------------------------------------------------------

Private Declare Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Function blnShell_Execute(ByVal strURL As String, _
Optional ByVal strParameters As String = vbNullString, _
Optional lngShow_Cmd As Long = vbNormalFocus) As Boolean

Dim blnReturn As Boolean
Dim lngHandle As Long

On Error GoTo Err_blnShell_Execute

blnReturn = False

lngHandle = ShellExecute(0&, vbNullString, strURL, strParameters, vbNullString, lngShow_Cmd)

blnReturn = (lngHandle > 31)

Exit_blnShell_Execute:

On Error Resume Next

blnShell_Execute = blnReturn

Exit Function

Err_blnShell_Execute:

blnReturn = False

Resume Exit_blnShell_Execute

End Function




Public Sub Open_Google_Searches()

  Dim objCell                                           As Range
 
  For Each objCell In [A1:A5]
 
      DoEvents
     
      If Not IsEmpty(objCell) Then
         If Not (blnShell_Execute("http://www.google.com/search?hl=en&q=%22" & objCell & "%22")) Then
            MsgBox "Could not launch:" & vbCrLf & vbLf & objCell, _
                    vbExclamation Or vbOKOnly, _
                    ActiveWorkbook.Name
         End If
      End If
     
  Next objCell
               
End Sub

' ...End of Code
finnstoneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

[ fanpages ]IT Services ConsultantCommented:
That code looks familiar (i.e. it was originally written by me).

Where did you source it from, finnstone?

I would like to help (again), if I can, but if you have a link to the original question it will help me check that any changes do not impact the original functionality.

Fundamentally, the "ShellExecute" function needs to be changed from:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

to:

Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rory ArchibaldCommented:
(NFP)

You'll also need to change:
Dim lngHandle As Long

Open in new window

to:
Dim lngHandle As LongPtr

Open in new window

as a result.
0
[ fanpages ]IT Services ConsultantCommented:
Thanks Rory.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

finnstoneAuthor Commented:
yes a LONG time ago. good to see you again!

thanks
0
[ fanpages ]IT Services ConsultantCommented:
:)
0
finnstoneAuthor Commented:
ive run your script at least 10k times
0
[ fanpages ]IT Services ConsultantCommented:
I noticed you have left it as originally formatted, even though you sought some amendments in this question:

"need to add some code to skip every other row in excel vba macro"

Glad to read it is still useful to you.
0
finnstoneAuthor Commented:
I have many variants of it now :)
0
Rory ArchibaldCommented:
I guess I should have spelled out the NFP... ;)
0
[ fanpages ]IT Services ConsultantCommented:
No problem, Rory; it was valuable input.
0
finnstoneAuthor Commented:
got a new one for you fanpages!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.