Consulting

Results 1 to 8 of 8

Thread: .bat script to open Access

  1. #1
    VBAX Regular
    Joined
    May 2011
    Posts
    63
    Location

    .bat script to open Access

    Hello,

    I have created a batch file that opens my database however I can not seem to get around the sandbox mode message that states "The file may not be safe if it....blah blah blah"

    I have tried adding [vba]WshShell.Sendkeys "o" [/vba] to my .bat file in the hopes that simulating the key stroke "O" will allow me to "click" through the and open the database so my autoexec macros will run. I've even added a delay [vba]TIMEOUT 10[/vba] to the .bat file.

    I've had no luck... been scouring the internet for hours trying to find a solution.

    I would greatly appreciate any insight into this!

    Cheers!!!
    tóg(a'í) go réidh é!

    Cheers!

  2. #2
    What version of Access?

    That sounds like the Intranet Zone security message.

    Is the database on the local hard drive?

    If in a mapped drive letter or network share folder, you can add the location on your LAN to to the Intranet Zones in the Internet Options

    See: http://www.youtube.com/watch?v=H8gjbVJaJHM
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    VBAX Regular
    Joined
    May 2011
    Posts
    63
    Location
    Hi HiTechCoach,

    Thanks for the reply.

    I can successfully open Access using the following .bat file:

    [VBA]
    C:\WINDOWS\system32\CCM\VAPPLA~1.EXE /launch "MS Access 2003 SP3 11.0.8166.0" "\\Grd-data001\grp\Savexec\Performance\Center\s.MDB"
    [/VBA]

    Part of my original problem was that Access is virtualized on my machine and that the actual .MDB file is on a network drive. I can get around that with the previous code. What I'm having trouble with is that "sandbox" message.

    I thought adding my computer name as a trusted zone via IE would work but I still get that "sandbox" message.

    It's frustrating that all I need to do is get my machine to recognize the keystroke "O" once I get the database open but it just won't do it.

    I'll give the youtube link you provided a shot. Maybe I did something wrone when adding my machine as a trusted zone.
    tóg(a'í) go réidh é!

    Cheers!

  4. #4
    I have never tried to launch Access that is virtualized on a machine.

    It is possible to modify the Access options for Macro Security and set it to low?
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  5. #5
    VBAX Regular
    Joined
    May 2011
    Posts
    63
    Location
    I have tried lowering the security setting but it reestablishes itself once I close the file. I think this has more to do with the application being virtualized though.

    I refuse to believe there is not a way to accomplish my goal so i will continue researching.

    I'm open to other suggestions/solutions.
    tóg(a'í) go réidh é!

    Cheers!

  6. #6
    I think the key will be to to make the setting changes for the macro security to low before Access is virtualized. That way the setting are stored in the virtual instance of Access
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  7. #7
    VBAX Regular
    Joined
    May 2011
    Posts
    63
    Location
    I agree with you however I don't think I have access to the program outside of the virtual environment unless I can edit some kind of user profile for myself.

    I'm also exploring usnig a VB script. I found this: http://www.dbforums.com/microsoft-ac...g-message.html

    I'm playing around with the VB script now. Haven't had much success though.
    tóg(a'í) go réidh é!

    Cheers!

  8. #8
    I will ask around to see if anyone has an answer other than creating a new Virtualized Access with the correct settings. So far that is what everyone is recommending.

    Please keep us updated on your progress,
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Posting Permissions

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