Problem with " Shell "

Posted on 2006-04-23
Last Modified: 2010-08-05
Hello everybody!...

Private Sub Label10_Click()
Shell "C:\Windows\HackingDigitalCrew\Security\FindNot.pbk", vbNormalFocus
End Sub

How can i fix this problem ? it is not working ... because its .pbk file i think .. please help me to resolve
Question by:KingSencat
    LVL 69

    Expert Comment

    by:Éric Moreau
    Hi KingSencat,

    What do you want to do?

    LVL 85

    Accepted Solution

    Use the ShellExecute() API instead of Shell():

    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 Const SW_HIDEWINDOW = &H80
    Private Const SW_SHOWNORMAL As Long = 1

    Private Sub Label10_Click()
        ShellExecute Me.hwnd, "Open", "C:\Windows\HackingDigitalCrew\Security\FindNot.pbk", 0&, 0&, SW_SHOWNORMAL
    End Sub
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now