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.
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.