Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim MyNewFileName As Variant
Dim Text1 As String Dim Text3 As String Text1 = "Program Status" Text3 = "NEXT" MyNewFileName = Text1 & " " & Text3 ActiveWorkbook.SaveCopyAs Filename:=MyNewFileName above code works, but resulting file "Program Status NEXT" is a "file" type, not an xls. however, when double-clicking on it in windows explorer, it does open with excel. i tried replacing last statement with: ActiveWorkbook.SaveCopyAs Filename:=MyNewFileName, _ FileFormat:=xlWorkbookNormal but i get a "compile error......... named argument not found". any suggestions? TIA susan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about just adding .xls to your string?
MyNewFileName = Text1 & " " & Text3 & ".xls" But since you're using .SaveCopyAs, it'll always be an exact copy--including the format of the file. Susan wrote: Dim MyNewFileName As Variant Dim Text1 As String Dim Text3 As String Text1 = "Program Status" Text3 = "NEXT" MyNewFileName = Text1 & " " & Text3 ActiveWorkbook.SaveCopyAs Filename:=MyNewFileName above code works, but resulting file "Program Status NEXT" is a "file" type, not an xls. however, when double-clicking on it in windows explorer, it does open with excel. i tried replacing last statement with: ActiveWorkbook.SaveCopyAs Filename:=MyNewFileName, _ FileFormat:=xlWorkbookNormal but i get a "compile error......... named argument not found". any suggestions? TIA susan -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dave Peterson wrote: How about just adding .xls to your string? i thought that would just create a file name that tacked .xls on the end, not influence the type of file. But since you're using .SaveCopyAs, it'll always be an exact copy--including the format of the file. then why is the copy a file, not an .xls? just wondering, will try the .xls add-on to filename. thanks! susan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave Peterson wrote:
MyNewFileName = Text1 & " " & Text3 & ".xls" it worked, thanks a lot....... but still wondering why the saveascopy didn't work. thank you! susan |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The file was a real excel file. But the name didn't include the extension.
Much like if you renamed the file in windows explorer. You could still use file|open to open that file and all your formulas, formatting, data would still be there. Susan wrote: Dave Peterson wrote: How about just adding .xls to your string? i thought that would just create a file name that tacked .xls on the end, not influence the type of file. But since you're using .SaveCopyAs, it'll always be an exact copy--including the format of the file. then why is the copy a file, not an .xls? just wondering, will try the .xls add-on to filename. thanks! susan -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Randon file saves | Excel Discussion (Misc queries) | |||
File saves as XML back to XLS? | Excel Discussion (Misc queries) | |||
excel file saves | Excel Discussion (Misc queries) | |||
Retrieve File Name before its saves | Excel Programming | |||
SaveCopyAs cannot access opened file? | Excel Programming |