ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs Macro Help? (https://www.excelbanter.com/excel-programming/286123-saveas-macro-help.html)

NeuralNetwork

SaveAs Macro Help?
 
Can anyone help me debug this section of code?

today = Format(Now, "ddmmmyy")
ActiveWorkbook.SaveAs
Filename:="F:\folder\my_file_" & today & ".txt", FileFormat:=x1Text,
CreateBackup:=False

I'm stumped


---
Message posted from http://www.ExcelForum.com/


Ron de Bruin

SaveAs Macro Help?
 
x1Text

Change to xlText

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"NeuralNetwork" wrote in message ...
Can anyone help me debug this section of code?

today = Format(Now, "ddmmmyy")
ActiveWorkbook.SaveAs
Filename:="F:\folder\my_file_" & today & ".txt", FileFormat:=x1Text,
CreateBackup:=False

I'm stumped


---
Message posted from http://www.ExcelForum.com/




No Name

SaveAs Macro Help?
 
Dont you want a _ after .SaveAs?



-----Original Message-----
Can anyone help me debug this section of code?

today = Format(Now, "ddmmmyy")
ActiveWorkbook.SaveAs
Filename:="F:\folder\my_file_" & today & ".txt",

FileFormat:=x1Text,
CreateBackup:=False

I'm stumped


---
Message posted from http://www.ExcelForum.com/

.



Andy Pope

SaveAs Macro Help?
 
Looks suspiciously like a 1 (one) instead of a l (letter L) in the
FileFormat constant.

Try, FileFormat:=xlText

NeuralNetwork wrote:

Can anyone help me debug this section of code?

today = Format(Now, "ddmmmyy")
ActiveWorkbook.SaveAs
Filename:="F:\folder\my_file_" & today & ".txt", FileFormat:=x1Text,
CreateBackup:=False

I'm stumped


---
Message posted from http://www.ExcelForum.com/


--

Cheers
Andy

http://www.andypope.info


NeuralNetwork[_2_]

SaveAs Macro Help?
 
Endless Thanks! You have made my day!


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 03:19 PM.

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