ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   linking external data (https://www.excelbanter.com/excel-programming/414294-linking-external-data.html)

eggpap

linking external data
 
hello,

how can I link external data (from Access tables) without referring the
DataSource to a fixed path, but to the Workbook path by VBA code?

Now I refer to a fixed path (e.g. C:\P1) containing the workbook and the mdb
files and the workbook refreshes the data external links at the opening, but
if the workbook is installed in another directory the refreshment process
fails or asks parameters that confuse the user.

Emiliano



Lars-Åke Aspelin[_2_]

linking external data
 
On Sat, 19 Jul 2008 14:33:45 +0200, "eggpap" wrote:

hello,

how can I link external data (from Access tables) without referring the
DataSource to a fixed path, but to the Workbook path by VBA code?

Now I refer to a fixed path (e.g. C:\P1) containing the workbook and the mdb
files and the workbook refreshes the data external links at the opening, but
if the workbook is installed in another directory the refreshment process
fails or asks parameters that confuse the user.

Emiliano


Use

ThisWorkbook.Path

to get the the path to your workbook

Hope this helps / Lars-Åke

eggpap

linking external data
 
hi,

I know that statement, but I don't know how to change the data source path
programmatically.

thanks,
Emiliano

--
Se hai fretta non hai tempo
perché il tempo non ha fretta

Emiliano
"Lars-Åke Aspelin" ha scritto nel messaggio
...
On Sat, 19 Jul 2008 14:33:45 +0200, "eggpap" wrote:

hello,

how can I link external data (from Access tables) without referring the
DataSource to a fixed path, but to the Workbook path by VBA code?

Now I refer to a fixed path (e.g. C:\P1) containing the workbook and the
mdb
files and the workbook refreshes the data external links at the opening,
but
if the workbook is installed in another directory the refreshment process
fails or asks parameters that confuse the user.

Emiliano


Use

ThisWorkbook.Path

to get the the path to your workbook

Hope this helps / Lars-Åke





All times are GMT +1. The time now is 10:01 AM.

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