Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paths when working with macros

Greetings,

I recently recorded a macro that I use to import data from the sam
directory that my spreadsheet resides in. After recording, the macr
gives the full path to the spreadsheet and the Microsoft Acces
database that I am using (i.e. C:\Stuff\Morestuff\myspreadsheet.xls).

This prevents me from simply moving the files to another computer t
use, since the other computer may not be running the import in the sam
location on the hard drive.

How do I tell the spreadsheet not go to a specific directory and jus
look for the files it needs in the same directory that the origina
spreadsheet resides?

Thanks

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paths when working with macros

Leave out the path, just use the workbook name. Excel automaticall
looks in the local folder first (unless you have changed i
subsequently by navigating to another folder via File/Open o
whatever). :-

myspreadsheet.xl

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Paths when working with macros

merlin63 wrote ...

How do I tell the spreadsheet not go to a specific directory and just
look for the files it needs in the same directory that the original
spreadsheet resides?


Use:

ThisWorkbook.Path

Jamie.

--
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
2007/macros not working hughesdm Excel Worksheet Functions 1 April 23rd 09 03:28 PM
Macros not working when file run on a Mac Darby Excel Discussion (Misc queries) 4 November 5th 07 02:49 PM
Paths for macros Tendresse Excel Discussion (Misc queries) 15 August 8th 07 02:50 AM
Working with Macros - Help needed!!! The Greek Excel Discussion (Misc queries) 2 November 19th 06 05:39 PM
Advise, please, how to get the following macros working: LikBez Excel Programming 0 August 19th 03 08:53 AM


All times are GMT +1. The time now is 12:57 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"