Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
I am using a macro that imports a text file, manipulates it and then saves it as an excel workbook. Right now, it is displaying the SaveAs dialog box and the user manually navigates to the location they want to save the file, then changes the saveAs file type box and clicks save. Two questions: 1) Can I have the SaveAs dialog box default the SaveAs file type to 'Excel Workbook'? 2) Can I have the whole SaveAs process happen without the dialog box popping up? (I tried doing: ThisWorkbook.SaveAs FileName:="Testing.xls" but it saves the file that I have the macro in, not the text file that was imported.) Any help would be much appreciated, Trevor |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trevor,
This works where FN = path and name of the file ''''''''''''''''''''''''''''''''''''''''''''' ActiveWorkbook.SaveAs Filename:=FN & "xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ''''''''''''''''''''''''''''''''''''''''''''' steve "Trevor" wrote in message ... Hello All, I am using a macro that imports a text file, manipulates it and then saves it as an excel workbook. Right now, it is displaying the SaveAs dialog box and the user manually navigates to the location they want to save the file, then changes the saveAs file type box and clicks save. Two questions: 1) Can I have the SaveAs dialog box default the SaveAs file type to 'Excel Workbook'? 2) Can I have the whole SaveAs process happen without the dialog box popping up? (I tried doing: ThisWorkbook.SaveAs FileName:="Testing.xls" but it saves the file that I have the macro in, not the text file that was imported.) Any help would be much appreciated, Trevor |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steve,
I am much appreciative for your help. Who knew "ActiveWorkbook" would be so different from "ThisWorkbook"? Thanks Again, Trevor -----Original Message----- Trevor, This works where FN = path and name of the file ''''''''''''''''''''''''''''''''''''''''''''' ActiveWorkbook.SaveAs Filename:=FN & "xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ''''''''''''''''''''''''''''''''''''''''''''' steve "Trevor" wrote in message ... Hello All, I am using a macro that imports a text file, manipulates it and then saves it as an excel workbook. Right now, it is displaying the SaveAs dialog box and the user manually navigates to the location they want to save the file, then changes the saveAs file type box and clicks save. Two questions: 1) Can I have the SaveAs dialog box default the SaveAs file type to 'Excel Workbook'? 2) Can I have the whole SaveAs process happen without the dialog box popping up? (I tried doing: ThisWorkbook.SaveAs FileName:="Testing.xls" but it saves the file that I have the macro in, not the text file that was imported.) Any help would be much appreciated, Trevor . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trevor,
Yep - took me awhile to learn that ThisWorkBook is where the code resides and ActiveWorkbook is any workbook that is currently active. -- steveb (Remove 'NoSpam' from email address if replying direct) wrote in message ... Steve, I am much appreciative for your help. Who knew "ActiveWorkbook" would be so different from "ThisWorkbook"? Thanks Again, Trevor -----Original Message----- Trevor, This works where FN = path and name of the file ''''''''''''''''''''''''''''''''''''''''''''' ActiveWorkbook.SaveAs Filename:=FN & "xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ''''''''''''''''''''''''''''''''''''''''''''' steve "Trevor" wrote in message ... Hello All, I am using a macro that imports a text file, manipulates it and then saves it as an excel workbook. Right now, it is displaying the SaveAs dialog box and the user manually navigates to the location they want to save the file, then changes the saveAs file type box and clicks save. Two questions: 1) Can I have the SaveAs dialog box default the SaveAs file type to 'Excel Workbook'? 2) Can I have the whole SaveAs process happen without the dialog box popping up? (I tried doing: ThisWorkbook.SaveAs FileName:="Testing.xls" but it saves the file that I have the macro in, not the text file that was imported.) Any help would be much appreciated, Trevor . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Keeping lead zeros in excel text format when saving as CSV file | Excel Worksheet Functions | |||
Saving a text file macro | Excel Discussion (Misc queries) | |||
Saving Excel file in DBase IV format | Excel Discussion (Misc queries) | |||
When saving CSV excel always prompts about the file format | Excel Discussion (Misc queries) | |||
Saving Excel 2003 file in .txt format | Excel Discussion (Misc queries) |