Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jo Jo is offline
external usenet poster
 
Posts: 113
Default Help with getsaveasfilename

Hi
I have the following code and MyStr = todays date which I have dimmed
previously

If (fso.FolderExists("D:\Documents and Settings\All Users\Documents"))
Then
Workbooks.Open Filename:="D:\Documents and Settings\All
Users\Documents\Forms.xls"
Dim fileSaveName
fileSaveName = Application.GetSaveAsFilename(["D:\Documents and
Settings\All Users\Documents\"] & MyStr, _
fileFilter:="All Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save the incident forms for this incident as " & fileSaveName
End If
ActiveSheet.SaveAs fileSaveName

However I need the user to enter the filename and then have it also attach
to the filename they have chosen what is in MyStr and I am unsure how to do
this now.

For Example the file will currently save as
D:\Documents and Settings\All Users\Documents\040607\name user calls file
when prompted

and I want it to save as
D:\Documents and Settings\All Users\Documents\040607\040607+name user calls
file.

Can anyone help please
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Help with getsaveasfilename

Const sPath = "C:\Documents and Settings\All Users\Documents"
Dim fileSaveName
Dim iPos As Long
If (fso.FolderExists(sPath)) Then
Workbooks.Open Filename:=sPath & "Forms.xls"
fileSaveName = Application.GetSaveAsFilename(sPath & myStr, _
fileFilter:="All Files (*.xls), *.xls")
If fileSaveName < False Then
iPos = InStrRev(fileSaveName, ".")
If iPos 0 Then
fileSaveName = Left(fileSaveName, iPos - 1) & "-" &
Format(myStr, "yyyymmdd") & ".xls"
MsgBox "Save the incident forms for this incident as " &
fileSaveName
ActiveSheet.SaveAs fileSaveName
End If
End If
End If

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Jo" wrote in message
...
Hi
I have the following code and MyStr = todays date which I have dimmed
previously

If (fso.FolderExists("D:\Documents and Settings\All Users\Documents"))
Then
Workbooks.Open Filename:="D:\Documents and Settings\All
Users\Documents\Forms.xls"
Dim fileSaveName
fileSaveName = Application.GetSaveAsFilename(["D:\Documents and
Settings\All Users\Documents\"] & MyStr, _
fileFilter:="All Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save the incident forms for this incident as " &
fileSaveName
End If
ActiveSheet.SaveAs fileSaveName

However I need the user to enter the filename and then have it also attach
to the filename they have chosen what is in MyStr and I am unsure how to
do
this now.

For Example the file will currently save as
D:\Documents and Settings\All Users\Documents\040607\name user calls file
when prompted

and I want it to save as
D:\Documents and Settings\All Users\Documents\040607\040607+name user
calls
file.

Can anyone help please



  #3   Report Post  
Posted to microsoft.public.excel.misc
Jo Jo is offline
external usenet poster
 
Posts: 113
Default Help with getsaveasfilename

Thanks very much Bob...works a treat.

"Bob Phillips" wrote:

Const sPath = "C:\Documents and Settings\All Users\Documents"
Dim fileSaveName
Dim iPos As Long
If (fso.FolderExists(sPath)) Then
Workbooks.Open Filename:=sPath & "Forms.xls"
fileSaveName = Application.GetSaveAsFilename(sPath & myStr, _
fileFilter:="All Files (*.xls), *.xls")
If fileSaveName < False Then
iPos = InStrRev(fileSaveName, ".")
If iPos 0 Then
fileSaveName = Left(fileSaveName, iPos - 1) & "-" &
Format(myStr, "yyyymmdd") & ".xls"
MsgBox "Save the incident forms for this incident as " &
fileSaveName
ActiveSheet.SaveAs fileSaveName
End If
End If
End If

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Jo" wrote in message
...
Hi
I have the following code and MyStr = todays date which I have dimmed
previously

If (fso.FolderExists("D:\Documents and Settings\All Users\Documents"))
Then
Workbooks.Open Filename:="D:\Documents and Settings\All
Users\Documents\Forms.xls"
Dim fileSaveName
fileSaveName = Application.GetSaveAsFilename(["D:\Documents and
Settings\All Users\Documents\"] & MyStr, _
fileFilter:="All Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save the incident forms for this incident as " &
fileSaveName
End If
ActiveSheet.SaveAs fileSaveName

However I need the user to enter the filename and then have it also attach
to the filename they have chosen what is in MyStr and I am unsure how to
do
this now.

For Example the file will currently save as
D:\Documents and Settings\All Users\Documents\040607\name user calls file
when prompted

and I want it to save as
D:\Documents and Settings\All Users\Documents\040607\040607+name user
calls
file.

Can anyone help please




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
GetSaveAsFilename not working in Excel 2003 Mayur Patel Excel Discussion (Misc queries) 8 September 11th 05 08:44 PM


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