changing a Word doc to Excel

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

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.
 
Hi Bob,
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)
 
Back
Top