ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Absolute path ?? (https://www.excelbanter.com/excel-programming/309298-absolute-path.html)

JoeH[_5_]

Absolute path ??
 
I've searched and searched to no avail so here is what I am trying t
do. I need make my excel app "portable". I am calling for VB to ope
up another .xls and i am wondering if it can be done with .\ vs havin
to type in the absolute path, thus having to make sure every user has t
have the folder in the same exact place. example:

WorkBooks.Open ".\database.xls"

will this work ?? provided of course all files are in the same folde
?

thanks
Jo

--
Message posted from http://www.ExcelForum.com


rich

Absolute path ??
 
if all files are kept in the same directory regardless of
its name you could use


x = ThisWorkbook.path
WorkBooks.Open x & "database.xls"



-----Original Message-----
I've searched and searched to no avail so here is what I

am trying to
do. I need make my excel app "portable". I am calling

for VB to open
up another .xls and i am wondering if it can be done

with .\ vs having
to type in the absolute path, thus having to make sure

every user has to
have the folder in the same exact place. example:

WorkBooks.Open ".\database.xls"

will this work ?? provided of course all files are in

the same folder
?

thanks
Joe


---
Message posted from http://www.ExcelForum.com/

.


JoeH[_6_]

Absolute path ??
 
Rich,

Many thanks for making my life much easier in the near future !!!
the code worked perfectly.

Thanks!!!
Joe


---
Message posted from http://www.ExcelForum.com/


Dave Peterson[_3_]

Absolute path ??
 
I think you'll need that extra backslash:

x = ThisWorkbook.path
WorkBooks.Open x & "\database.xls"

rich wrote:

if all files are kept in the same directory regardless of
its name you could use

x = ThisWorkbook.path
WorkBooks.Open x & "database.xls"

-----Original Message-----
I've searched and searched to no avail so here is what I

am trying to
do. I need make my excel app "portable". I am calling

for VB to open
up another .xls and i am wondering if it can be done

with .\ vs having
to type in the absolute path, thus having to make sure

every user has to
have the folder in the same exact place. example:

WorkBooks.Open ".\database.xls"

will this work ?? provided of course all files are in

the same folder
?

thanks
Joe


---
Message posted from http://www.ExcelForum.com/

.


--

Dave Peterson



All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com