Shell problems in windows 7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Bowyer
    New Member
    • Nov 2010
    • 94

    #1

    Shell problems in windows 7

    I have the following code which works fine in XP but not in windows 7:

    Code:
    ChDrive [tboxdrive]
    Dim openfolder As String
    openfolder = "explorer.exe " & [tboxdrive] & [tboxfolderpath] & "\" & [CustomerSelect] & "\" & [Site] & " - " & [tboxjobno]
    
    Shell (openfolder)
    What do I need to change to make it run in Windows 7? And if I change it, will it then work in XP? Or will I have to have 2 seperate functions, one for Windows 7 users, and one for XP users (not a massive problem, I already have a table which Identifies the computer, I'd just need to manually state whether the computer is Win7 or XP).

    Obviosuly one size fits all answer is preferable!
  • James Bowyer
    New Member
    • Nov 2010
    • 94

    #2
    Anyone? Other sites suggest shellexecute, but that doesn't seem to work either.

    The excel shell which is written virtually identically works in Windows 7 though, oddly enough, so it must just be a problem with Explorer.

    Comment

    • James Bowyer
      New Member
      • Nov 2010
      • 94

      #3
      I sort of fixed it using:
      Code:
      ChDrive [tboxdrive]
      Dim openfolder As String
      openfolder = [tboxdrive] & [tboxfolderpath] & "\" & [CustomerSelect] & "\" & [Site] & " - " & [tboxjobno]
      
      Application.FollowHyperlink openfolder
      However it now displays the whole file path in the window, which is something I'd rather avoid if at all possible.

      Is there any way to do this using the Application.fol lowhyperlink method, or is that only possible with shell and explorer.exe?

      Comment

      • James Bowyer
        New Member
        • Nov 2010
        • 94

        #4
        Is there any other way to launch excel in windows 7 other than the Application.Fol lowhyperlink option?

        Comment

        Working...