Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / April 2007

Tip: Looking for answers? Try searching our database.

RunApp

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nightshade - 30 Apr 2007 20:48 GMT
I have the created a Macro for a RunApp with a command line of:

C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe "N:\Desktop\Tech
Database\Report-Province.xls"

This works fine, however I do have a question.  Is there any way to change
this command line, so that it does not look in the N drive then Desktop then
the Tech Databse folder, but instead looks in the same folder that the access
database is in?  I want to be able to move my folder to different places and
still have this code work.
'69 Camaro - 30 Apr 2007 21:37 GMT
Hi.

> Is there any way to change
> this command line, so that it does not look in the N drive then Desktop
> then
> the Tech Databse folder, but instead looks in the same folder that the
> access
> database is in?

If you move the XLS file, then you must change this code's file path
(N:\Desktop\Tech Database\) to the new path where the XLS file is located.
Therefore, if the XLS file is always in the same directory as the database
application, then try the following syntax, and ensure that there's a space
character after the file name of the executable and a slash character before
the Excel file name:

   stAppName = "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE " & _
       CurrentProject.Path & "\Report-Province.xls"

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.

>I have the created a Macro for a RunApp with a command line of:
>
[quoted text clipped - 9 lines]
> and
> still have this code work.
'69 Camaro - 30 Apr 2007 22:04 GMT
Hi.

I'm sorry.  I misread your question.  You have a macro, not a VBA procedure.
The code I gave you will work in a procedure created by the Command Button
Wizard.  Run the Wizard to automatically create the procedure's code for
you, and replace the line of code that's hard coded with the N:\ drive path
to what I've given you.  Save and compile the code, then open the form in
Form View and select the button to open your spreadsheet file.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.

> Hi.
>
[quoted text clipped - 38 lines]
>> and
>> still have this code work.
Larry Daugherty - 30 Apr 2007 21:57 GMT
Access and "macro" are words that don't go together well.  If you use
VBA ("macro" in all other Office platforms) you can easily do what you
ask.

HTH
Signature

-Larry-
--

> I have the created a Macro for a RunApp with a command line of:
>
[quoted text clipped - 6 lines]
> database is in?  I want to be able to move my folder to different places and
> still have this code work.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.