Need help getting this file to save. I am wanting to use this script to open a text file and save it as a .csv and then close. The file is in a fixed field format. Thanks for any help you can provide. Should be easy, but this is my first script. Thanks.
Const xlFixedWidth = 2
Set objExcel = CreateObject("Excel.Application")objExcel.Visible = TrueobjExcel.Workbooks.OpenText _ "C:Documents and Settingsspa2329DesktopNew FolderTest1",,,xlFixedWidth,,,,,,,,,Array(Array(0,1),Array(12,1),Array(22,1))objExcel.Workbooks.Open.SaveA("d:appsbedtrackertest1.csv")objExcel.Quit
Need help Saving .csv in script
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- jdelatorre@hfinc.com
- Posts: 54
- Last visit: Wed Jan 30, 2008 1:42 am
Need help Saving .csv in script
Thanks Joel. That worked great. Does anyone know how I can save it without user intervention?
Thanks.
Thanks.
Need help Saving .csv in script
I dont want it to ask for confirmation that I would like to save or overwrite the existing file.
Thanks
Thanks
- jdelatorre@hfinc.com
- Posts: 54
- Last visit: Wed Jan 30, 2008 1:42 am
Need help Saving .csv in script
The saveas method has a grip of parameters for it. I think it does have one that you can pass to overwrite, etc.. Lookup the method on MSDN.