LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Saving filename same as import filename

I tried this code but I get an error that says Method 'SaveAs' of object '_Workbook' failed. I can't figure out what the problem is other than maybe it is naming the excel workbook the same as the text file it is importing. For example it is naming it test.txt.xls. Could this be a problem? fileToOpen is the name of the text file that I am importing. Thanks. Mat

ActiveWorkbook.SaveAs Filename:="H:\" & fileToOpen & ".xls", FileFormat:=xlNormal,
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
CreateBackup:=False


 
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
Saving file using value in cell as the filename BCassedy Excel Worksheet Functions 3 July 7th 07 12:43 AM
Saving XLS workbook with set filename levertonfamily Excel Discussion (Misc queries) 0 November 16th 06 05:52 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
Filename import CiceroCF Excel Discussion (Misc queries) 4 January 4th 06 01:54 PM
Saving Cell value as filename Kathy B Excel Programming 1 July 24th 03 10:59 PM


All times are GMT +1. The time now is 04:05 AM.

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"