Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Opening a file

I am trying to open a file that I have saved. I am having the following
problem.

Sometimes it will open but other times I have to change the path.

The problem I have is that because I distribute the main file to several
people the exact path is different because of the user profile.


Workbooks.Open Filename:= _
"Ugrounds.xls"

Is there a way to stop the debugger from coming up and changing the path?

Thanks in advance.

Ed Davis

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Opening a file

Davis,

I have an idea that you have to make a database or setting wich a file
contains data about your clients like: [UserName];[Path]
example:

John;C\DATA\2007\
Edgar;E\SERVERDATA\
etc...

Wich saved in a txt file then you have to initialize to read them before
saving file

--

Regards,

Halim


"Ed Davis" wrote:

I am trying to open a file that I have saved. I am having the following
problem.

Sometimes it will open but other times I have to change the path.

The problem I have is that because I distribute the main file to several
people the exact path is different because of the user profile.


Workbooks.Open Filename:= _
"Ugrounds.xls"

Is there a way to stop the debugger from coming up and changing the path?

Thanks in advance.

Ed Davis

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Opening a file

Ed,
If you do not know what the path is, get the user to locate it first. See:
Application.GetOpenFilename

NickHK

"Ed Davis" wrote in message
...
I am trying to open a file that I have saved. I am having the following
problem.

Sometimes it will open but other times I have to change the path.

The problem I have is that because I distribute the main file to several
people the exact path is different because of the user profile.


Workbooks.Open Filename:= _
"Ugrounds.xls"

Is there a way to stop the debugger from coming up and changing the path?

Thanks in advance.

Ed Davis



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Opening a file

The path is always the same except for the user profile.

Example :
C:\Documents and settings\store2113\my documents\dailywork\Ugrounds.xls


The "store2113" is the only thing that is different.

Is there a way to have the macro open the file using
"C:\Documents and settings\%user profile%\My
Documents\Dailywwork\ugrounds.xls"?




"NickHK" wrote in message
...
Ed,
If you do not know what the path is, get the user to locate it first. See:
Application.GetOpenFilename

NickHK

"Ed Davis" wrote in message
...
I am trying to open a file that I have saved. I am having the following
problem.

Sometimes it will open but other times I have to change the path.

The problem I have is that because I distribute the main file to several
people the exact path is different because of the user profile.


Workbooks.Open Filename:= _
"Ugrounds.xls"

Is there a way to stop the debugger from coming up and changing the path?

Thanks in advance.

Ed Davis




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Opening a file

Ed,
?Environ("UserName")

NickHK

"Ed Davis"
...
The path is always the same except for the user profile.

Example :
C:\Documents and settings\store2113\my documents\dailywork\Ugrounds.xls


The "store2113" is the only thing that is different.

Is there a way to have the macro open the file using
"C:\Documents and settings\%user profile%\My
Documents\Dailywwork\ugrounds.xls"?




"NickHK" wrote in message
...
Ed,
If you do not know what the path is, get the user to locate it first.
See:
Application.GetOpenFilename

NickHK

"Ed Davis" wrote in message
...
I am trying to open a file that I have saved. I am having the following
problem.

Sometimes it will open but other times I have to change the path.

The problem I have is that because I distribute the main file to several
people the exact path is different because of the user profile.


Workbooks.Open Filename:= _
"Ugrounds.xls"

Is there a way to stop the debugger from coming up and changing the
path?

Thanks in advance.

Ed Davis






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
Opening file in Excel 2003 opens multipule instances of same file Ed_B Excel Discussion (Misc queries) 1 June 21st 07 07:10 PM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
Error:Invalid File format,while opening an Excel Template file Saurabh Excel Programming 1 January 17th 05 07:15 AM


All times are GMT +1. The time now is 02:21 AM.

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"