Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
GetSaveAsFilename not working in Excel 2003 | Excel Discussion (Misc queries) |