Solved

Vb syntax Visual Studio 2010: Shell syntax

Posted on 2013-10-25
2
332 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 500 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why is enum singleton a better approach than static factory 3 50
Visual studio 2015 1 34
VB.NET Application Installation with sqlserver 8 45
Do Wend Macro not working 22 56
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…

749 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