Welcome !
         

 hta and broseforfolder causes an error

Author Message
diego.torres.zamora

  • Total Posts : 13
  • Scores: 0
  • Reward points : 0
  • Joined: 11/15/2016
  • Status: offline
hta and broseforfolder causes an error Tuesday, January 10, 2017 9:10 PM (permalink)
0
hello to all vbs/hta gurus.
I have a hta and I need to browse for an exe file. The function I'm using is browseforfile and if I choose a txt file or pdf, it works just as expected.
But if I chosse an exe file it rises an error.
The error has code: 0
The error cause: unknown
Error line:

Set F = SA.BrowseForFolder(0, "Choose a folder", &H4200, 0)

Here is the complete code for browsing for  folder/file
Function PickFolder()
    Dim SA, F
    Set SA = CreateObject("Shell.Application")
    Set F = SA.BrowseForFolder(0, "Choose a folder", &H4200, 0)
    If (Not F Is Nothing) Then
      PickFolder = F.Items.Item.path
    End If
    Set F = Nothing
    Set SA = Nothing
End Function 

Greetings
Diego
 
p.s. Non omnia possum omnes!
 
#1
    59cobalt

    • Total Posts : 2609
    • Scores: 253
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: offline
    Re:hta and broseforfolder causes an error Thursday, January 12, 2017 7:26 AM (permalink)
     
    #2
      diego.torres.zamora

      • Total Posts : 13
      • Scores: 0
      • Reward points : 0
      • Joined: 11/15/2016
      • Status: offline
      Re:hta and broseforfolder causes an error Thursday, January 12, 2017 8:43 PM (permalink)
      0
      Ok, got it.
      But if I use the"commondialog" function, I receive the "ActiveX"-error.
      Is there a way to brose for an exe-file without using the commondialog?
       
      <message edited by diego.torres.zamora on Thursday, January 12, 2017 9:03 PM>
      Greetings
      Diego
       
      p.s. Non omnia possum omnes!
       
      #3
        59cobalt

        • Total Posts : 2609
        • Scores: 253
        • Reward points : 0
        • Joined: 7/17/2011
        • Status: offline
        Re:hta and broseforfolder causes an error Thursday, January 12, 2017 9:16 PM (permalink)
        0
        Also related. I don't use this kind of thing often, so I'm not aware if there still is a working ready-made file-browsing dialog available for VBScript.
         
        #4
          diego.torres.zamora

          • Total Posts : 13
          • Scores: 0
          • Reward points : 0
          • Joined: 11/15/2016
          • Status: offline
          Re:hta and broseforfolder causes an error Thursday, January 12, 2017 11:42 PM (permalink)
          0
          Perferct
          Exactly what I was looking for!
          Thank you.
          Greetings
          Diego
           
          p.s. Non omnia possum omnes!
           
          #5
            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2017 ASPPlayground.NET Forum Version 3.9