View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Melanie Breden Melanie Breden is offline
external usenet poster
 
Posts: 88
Default changing a Word doc to Excel

Hi Bob,

Bob wrote:
I have a macro that allows a user to pick Word document
file from a list(as a text file), formats the columns and
adds a header then saves the file as an Excel document.
The file opens in one drive and saves in another.

The problem I have is that the file still has the .doc in
the filename and saves as a .doc file not Excel (even if
Microsoft office Excel Workbook is used as in

filesavename = Application.GetSaveAsFilename( _
fileFilter:="microsoft office excel workbook Files
(*.xls), *.xls")
How do I take out the .doc from the filename?
This is done in Excel 2003.


replace the string with nothing:

FileSaveName = Application.GetSaveAsFilename( _
InitialFileName:=Replace(ActiveWorkbook.Name, ".doc", ""), _
fileFilter:="microsoft office excel workbook Files(*.xls), *.xls")

--
Regards

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)