Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Command to run access word etc from within VB

  1. #1
    Join Date
    Jan 2005
    Posts
    498
    Rep Power
    0

    Default Command to run access word etc from within VB

    I need to run access from within VB, a button clicks then access runs. Problem is i dont know what the command is, I tried "Microsoft Access" but that didnt work, its supposed to be the same command that you use from the command prompt right? so i tried that in the command prompt i get a folder opening name Microsft located at "C:\WINDOWS\system32\Microsoft". Am i using the wrong command, also this is the code i have basically
    "AppActivate Shell("Microsoft Access" & App.Path & "\comp dep inventory(access97 format).mdb", vbNormalFocus)"
    If anyone knows can you tell me the correct command.
    P.S I am running Microsoft Office 2003, does that make a difference?
    Notorios
    That Which Is Not Defined Is Infinitely Great
    Google The Search Engine Of The Gods

  2. #2
    Join Date
    Mar 2004
    Posts
    232
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    Well you need to learn some VBA and use Google more any way to launch an app from VB. You can use the following code.

    Dim myapp As Outlook.Application
    Set myapp = createobject("Outlook.Application")

    Look up some information on MS office automation

  3. #3
    Join Date
    Mar 2004
    Posts
    123
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    Did a little search and came up on this site Think it will give you some assistance
    There is no wrong or right, only consequencies to action

    "It is the duty of man to make his knowledge so complete in life, so as to make it impossible for any other to take advantage of him" - Marcus Garvey

  4. #4
    Join Date
    Jan 2005
    Posts
    498
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    Well you sorta helped, i just found out another way to launch and application, but what i really need to know is the application name to use to launch access. I cant find that and thats wats the real problem
    Notorios
    That Which Is Not Defined Is Infinitely Great
    Google The Search Engine Of The Gods

  5. #5
    Join Date
    Mar 2004
    Posts
    123
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    Hope this is what your asking for. In most casses the .exe for access is located at C:\Program Files\Microsoft Office\Office10\msaccess.exe

    for word its C:\Program Files\Microsoft Office\Office10\winword.exe
    There is no wrong or right, only consequencies to action

    "It is the duty of man to make his knowledge so complete in life, so as to make it impossible for any other to take advantage of him" - Marcus Garvey

  6. #6
    Join Date
    Jan 2005
    Posts
    498
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    Well that can work i wasnt too sure about the path for Microsoft access or word, but my problem isnt the location of the executable. See if i use the path with the exapmle previously given on your site it will only work with a set directory for the Microsoft Products. What if the user has a different directory and also that directory is for Office XP right or Office 2000 but i use 2003 so my directory is C:\Program Files\Microsoft Office\Office11\winword.exe as opposed to C:\Program Files\Microsoft Office\Office10\winword.exe, so im looking for the Cmd line for it if there is one. That is the command i can type into the Run menu to run it, like notepad's comman is notepad or the calculator is calc
    Notorios
    That Which Is Not Defined Is Infinitely Great
    Google The Search Engine Of The Gods

  7. #7
    Join Date
    Mar 2004
    Posts
    123
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    Quote Originally Posted by Notorios
    That is the command i can type into the Run menu to run it, like notepad's comman is notepad or the calculator is calc
    For me,typing winword or msaccess in run load the applications.
    From the command prompt start winword or start msaccess also load the applications.

    Hope that helped
    There is no wrong or right, only consequencies to action

    "It is the duty of man to make his knowledge so complete in life, so as to make it impossible for any other to take advantage of him" - Marcus Garvey

  8. #8
    Join Date
    Jan 2005
    Posts
    498
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    oh, zeeeeen, thanx yo, thanx a million. I was typing microsoft access instead of msaccess. that exactly solves my problem. thanx again
    Notorios
    That Which Is Not Defined Is Infinitely Great
    Google The Search Engine Of The Gods

  9. #9
    Join Date
    Mar 2004
    Posts
    123
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    You're more than welcome. We are all here to help each other
    There is no wrong or right, only consequencies to action

    "It is the duty of man to make his knowledge so complete in life, so as to make it impossible for any other to take advantage of him" - Marcus Garvey

  10. #10
    Join Date
    Jan 2005
    Posts
    498
    Rep Power
    0

    Default Re: Command to run access word etc from within VB

    Well apparently that command works in the run command, but what i actually need is the one that works in the command promt , this i annoying, well look like i using the way suggested on that site that was given, but thanks anyways
    Notorios
    That Which Is Not Defined Is Infinitely Great
    Google The Search Engine Of The Gods

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •