ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changing a Word doc to Excel (https://www.excelbanter.com/excel-programming/296126-changing-word-doc-excel.html)

bob

changing a Word doc to Excel
 
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.

Melanie Breden

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)



All times are GMT +1. The time now is 09:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com