Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Saving text file in excel format through macro...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Saving text file in excel format through macro...

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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Saving text file in excel format through macro...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Saving text file in excel format through macro...

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
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
Keeping lead zeros in excel text format when saving as CSV file Richard James Excel Worksheet Functions 1 March 31st 08 11:30 AM
Saving a text file macro jknapp1005 Excel Discussion (Misc queries) 2 September 5th 06 08:01 PM
Saving Excel file in DBase IV format CrawdadSolstice Excel Discussion (Misc queries) 9 March 20th 06 10:39 PM
When saving CSV excel always prompts about the file format SimonW-UK Excel Discussion (Misc queries) 2 November 16th 05 10:34 AM
Saving Excel 2003 file in .txt format mikejfox99 Excel Discussion (Misc queries) 2 August 5th 05 05:12 PM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"