#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default File Names

I have one last issue to finish this project. I have a program that uses multipe excel workbooks, and macros that open and access these workbooks as needed. Where my difficulty comes in is in the way they are named in the macro

Example

Workbooks.Open Filename:=
"C:\Documents and Settings\The Competitive Edge\My Documents\Inventory_Program\Inventory.xls

This works only if the person installs the program in that exact location - if not then the program can't find the file. I need to find a way, if possible, to make it so that I can reference it just from the single directory, so in this example it would be in "Inventory Program\Inventory.xls". All the workbooks that I use will be in this one directory, but all the rest depends on where it is installed on a specific computer

I hope this makes since, any help would be greatly appreciated

James
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default File Names

Is the workbook with the code in the same folder?

If yes, then you could use this fact:

workbooks.open filename:=thisworkbook.path & "\" & "inventory.xls"



James Stephens wrote:

I have one last issue to finish this project. I have a program that uses multipe excel workbooks, and macros that open and access these workbooks as needed. Where my difficulty comes in is in the way they are named in the macro.

Example:

Workbooks.Open Filename:= _
"C:\Documents and Settings\The Competitive Edge\My Documents\Inventory_Program\Inventory.xls"

This works only if the person installs the program in that exact location - if not then the program can't find the file. I need to find a way, if possible, to make it so that I can reference it just from the single directory, so in this example it would be in "Inventory Program\Inventory.xls". All the workbooks that I use will be in this one directory, but all the rest depends on where it is installed on a specific computer.

I hope this makes since, any help would be greatly appreciated.

James


--

Dave Peterson

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
File names Augied Excel Worksheet Functions 3 January 14th 09 02:37 AM
Open Excel file get error with file names that have spaces in the Kozmo Setting up and Configuration of Excel 6 October 29th 08 02:51 AM
File Names [email protected] Excel Worksheet Functions 1 August 29th 06 12:46 PM
EXCEL97 FILE NAMES TRUNCATED TO THE FIRST LETTER IN THE FILE NAME Geoff Porter New Users to Excel 6 May 25th 06 08:31 PM
File Names garyntn Excel Worksheet Functions 1 May 5th 06 02:39 PM


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