#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default file names

When I use the SaveAs function as follows:

ActiveWorkbook.SaveAs Filename:="H:\A\B\Sept 10 2003
\Sept10-1.xls", AccessMode:=xlShared
....when I open Sept10-1.xls, it says that it is shared,
but when I use:

ActiveWorkbook.SaveAs Filename:="Sept10-1.xls",
AccessMode:=xlShared
....when I open Sept10-1.xls, it doesn't say that it is
shared.

How do I get it so that it saves to the current directory
without having to type in all that information?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default file names

Mika,

Dim Path as String, Filename as String
Path = "H:\A\B\Sept 10 2003\"
Filename = "Sept10-1.xls"
ActiveWorkbook.SaveAs Filename:= Path & Filename, AccessMode:=xlShared

next file.........

Filename = "Sept10-2.xls"
ActiveWorkbook.SaveAs Filename:= Path & Filename, AccessMode:=xlShared

etc,..........

You could use Filename = Date & "-1.xls" which would give you
"9/10/2003-1.xls" or something similar, depending on your windows date
format.

HTH
Henry

"mika." wrote in message
...
When I use the SaveAs function as follows:

ActiveWorkbook.SaveAs Filename:="H:\A\B\Sept 10 2003
\Sept10-1.xls", AccessMode:=xlShared
...when I open Sept10-1.xls, it says that it is shared,
but when I use:

ActiveWorkbook.SaveAs Filename:="Sept10-1.xls",
AccessMode:=xlShared
...when I open Sept10-1.xls, it doesn't say that it is
shared.

How do I get it so that it saves to the current directory
without having to type in all that information?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default file names

Henry,

Thanks for your response. However, I would like the user
to, no matter where they put the file, to have it save to
that directory. I thought this was possible with
ActiveWorkbook.SaveAs Filename:="Sept10-1.xls",
AccessMode:=xlShared

but I don't think it is saving to the right director,
because when I reopen the file it is not shared.

Any further ideas?
Thanks...

-----Original Message-----
Mika,

Dim Path as String, Filename as String
Path = "H:\A\B\Sept 10 2003\"
Filename = "Sept10-1.xls"
ActiveWorkbook.SaveAs Filename:= Path & Filename,

AccessMode:=xlShared

next file.........

Filename = "Sept10-2.xls"
ActiveWorkbook.SaveAs Filename:= Path & Filename,

AccessMode:=xlShared

etc,..........

You could use Filename = Date & "-1.xls" which would

give you
"9/10/2003-1.xls" or something similar, depending on

your windows date
format.

HTH
Henry

"mika." wrote in message
...
When I use the SaveAs function as follows:

ActiveWorkbook.SaveAs Filename:="H:\A\B\Sept 10 2003
\Sept10-1.xls", AccessMode:=xlShared
...when I open Sept10-1.xls, it says that it is shared,
but when I use:

ActiveWorkbook.SaveAs Filename:="Sept10-1.xls",
AccessMode:=xlShared
...when I open Sept10-1.xls, it doesn't say that it is
shared.

How do I get it so that it saves to the current

directory
without having to type in all that information?

Thanks.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default file names

Mika,

What directory do you mean by "save to *that* directory"
From your original post, I understood that the directory you want to save in
is "H:\A\B\Sept 10 2003\"
The user would have no choice, as the program will save itself.
In my original post, I used Path and Filename as variable names.
These are Excel keywords so are not allowed.
Sorry for the confusion.

Put this in the Workbook Before_Close event

Dim MyPath as String, MyFilename as String
MyPath = "H:\A\B\Sept 10 2003\" or whatever directory you want to save in.
MyFilename = "Sept10-1.xls" or whatever filename you want.
ActiveWorkbook.SaveAs Filename:= MyPath & MyFilename,
AccessMode:=xlShared
etc.

If you want to save the file back to the directory from whence it came
MyPath = ActiveWorkbook.Path

HTH
Henry


"mika." wrote in message
...
Henry,

Thanks for your response. However, I would like the user
to, no matter where they put the file, to have it save to
that directory. I thought this was possible with
ActiveWorkbook.SaveAs Filename:="Sept10-1.xls",
AccessMode:=xlShared

but I don't think it is saving to the right director,
because when I reopen the file it is not shared.

Any further ideas?
Thanks...

-----Original Message-----
Mika,

Dim Path as String, Filename as String
Path = "H:\A\B\Sept 10 2003\"
Filename = "Sept10-1.xls"
ActiveWorkbook.SaveAs Filename:= Path & Filename,

AccessMode:=xlShared

next file.........

Filename = "Sept10-2.xls"
ActiveWorkbook.SaveAs Filename:= Path & Filename,

AccessMode:=xlShared

etc,..........

You could use Filename = Date & "-1.xls" which would

give you
"9/10/2003-1.xls" or something similar, depending on

your windows date
format.

HTH
Henry

"mika." wrote in message
...
When I use the SaveAs function as follows:

ActiveWorkbook.SaveAs Filename:="H:\A\B\Sept 10 2003
\Sept10-1.xls", AccessMode:=xlShared
...when I open Sept10-1.xls, it says that it is shared,
but when I use:

ActiveWorkbook.SaveAs Filename:="Sept10-1.xls",
AccessMode:=xlShared
...when I open Sept10-1.xls, it doesn't say that it is
shared.

How do I get it so that it saves to the current

directory
without having to type in all that information?

Thanks.



.



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 Mr Widget Excel Worksheet Functions 3 March 24th 10 01:06 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 Esradekan Excel Worksheet Functions 4 July 27th 08 09:54 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 05:36 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"