Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Vb syntax Visual Studio 2010: Shell syntax

Posted on 2013-10-25
2
Medium Priority
?
348 Views
Last Modified: 2013-10-25
I am trying to launch an Access Database but it does not work: -
  Dim Pathstr As String
            Pathstr = "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"
            Dim Exestr As String
            Exestr = "C:\My Folder\My AccessDb.mdb"
            MsgBox(Pathstr & " " & Exestr)
            Shell(Pathstr & " " & Exestr)

Open in new window

I think it may be the spaces in the folder name, can anyone help?
0
Comment
Question by:HKFuey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
chaau earned 2000 total points
ID: 39599936
You are right. It is the spaces. You need to surround paths with double quotes:
Dim Pathstr As String
            Pathstr = """C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"""
            Dim Exestr As String
            Exestr = """C:\My Folder\My AccessDb.mdb"""
    

Open in new window

0
 

Author Closing Comment

by:HKFuey
ID: 39600032
Super, thanks very much!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Introduction to Processes

715 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