Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default define relative path from xls to xml file

Hi All,

i have an excel-project with a separate xml file where config
information is stored. this xml is reference through a public constant
with an absolute path, like that:

Public Const strXMLFile As String = "D:\Documents and
Settings\t119637\Desktop\xls_work\Config\config.xm l"

This works as long as the xls file runs on the machine where this
absolute file path is existing.
If i'd like to move these files (the excel file with the vba code and
the xml file) to another machine where this path is not existing, the
excel sheet wont work cause the xml file is not found.
Is there a ways to define a relative path to the xml file startin from
the actual xls file?
E.g:
the excel is stored in:
xls_work/myFile.xls
and the xml file is stored in
xls_work\Config\config.xml

So i would assume that the vba code needs to determine what the path to
the xls file is and add a /Config/config.xml to that path to have the
xls file work with the settings in the xml file.

I dont know the vba code that makes this possible

help woul be greatly apreciated
regards
thomas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default define relative path from xls to xml file

Hi Thomas,
Seeing that you haven't received any responces as of yet, the only relative
path I know of is Application.Path, which returns the directory that the
Excel application is stored in. But that would mean you'd have to store your
files off of Excel's application path.
Another "out there" idea is to load the relative-portion of the path from a
text file.
HTH
Trent Argante
[DC.J(n/a)]


" wrote:

Hi All,

i have an excel-project with a separate xml file where config
information is stored. this xml is reference through a public constant
with an absolute path, like that:

Public Const strXMLFile As String = "D:\Documents and
Settings\t119637\Desktop\xls_work\Config\config.xm l"

This works as long as the xls file runs on the machine where this
absolute file path is existing.
If i'd like to move these files (the excel file with the vba code and
the xml file) to another machine where this path is not existing, the
excel sheet wont work cause the xml file is not found.
Is there a ways to define a relative path to the xml file startin from
the actual xls file?
E.g:
the excel is stored in:
xls_work/myFile.xls
and the xml file is stored in
xls_work\Config\config.xml

So i would assume that the vba code needs to determine what the path to
the xls file is and add a /Config/config.xml to that path to have the
xls file work with the settings in the xml file.

I dont know the vba code that makes this possible

help woul be greatly apreciated
regards
thomas


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Relative path for XML data file? Mark W. Robbins Charts and Charting in Excel 0 June 7th 06 06:41 AM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
define a database path Laurent M Excel Programming 1 January 31st 05 12:14 AM
relative reference in a macro to define a name Hal Forman Excel Programming 2 May 28th 04 07:13 PM
how shall i define the path when using export? vacaut[_4_] Excel Programming 1 November 19th 03 05:07 PM


All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"