• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Showing smartphone folder takes long time

00Harry

New Member
Hello,
The code below takes about 1 minute to find the folder on the smartphone. If I start the process again, the page comes up immediately. If I disconnect the smartphone from the computer and reconnect it again, it takes about 1 minute again for the folder to be found on the smartphone. Why is that? The code was not created by me. I know a bit about VBA, but I'm not an expert at it. Maybe someone knows how to improve it.

Thanks for the help. Greeting Harry

>>> use code - tags <<<
Code:
Function GetPhoneCLSID(name As String)
Set objShellApp = CreateObject("Shell.Application")
Set objFolder = objShellApp.Namespace("shell:MyComputerFolder")

For Each objItem In objFolder.Items()
If InStr(1, objItem.name, name, vbTextCompare) > 0 Then
GetPhoneCLSID = objItem.Path
End If
Next
End Function


Sub a()
Shell "explorer " & GetPhoneCLSID("Galaxy") & "\Phone", vbNormalFocus 'CopyGalaxy
End Sub
 
Last edited by a moderator:
Hello, not a VBA concern but an OS one …​
Just try : connect the device, wait a while at least one minute or more then launch the VBA procedure.​
 
After waiting 5 minutes it was the same.
For making one action it is in this way not usefull. Making manual without excel it goes quicker.
Do you know a possibility making this faster starting with excel?
 
As this is not an Excel feature maybe you may have more chance on an OS forum to get another way …​
 
Back
Top