anthonyjr2 Posted July 12, 2018 Share Posted July 12, 2018 Hey everyone, Recently started using AutoIt at work again and came up with this interesting problem. I'm trying to import a .txt file in Fixed Width mode, except the columns need to be slightly modified before the import completes. Usually this would be done by moving them over in the wizard, but I don't see if there is a way to do this automatically through AutoIt. I would rather not have to do it using MouseMove() on the import wizard but if that is my only solution that's what I will end up doing. I'm currently using _Excel_BookOpenText($oExcel, @ScriptDir & "\419.txt", Default, $xlFixedWidth) Which opens the file with incorrect column widths. I can't seem to find an option in the UDF to be able to change the widths of the column at all. They will always be the same size so if there was a way for me to just hardcode the width number in I could do what I need. Any suggestions/Is this possible? Thanks for any help. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= Link to comment Share on other sites More sharing options...
water Posted July 12, 2018 Share Posted July 12, 2018 Please check https://msdn.microsoft.com/en-us/vba/excel-vba/articles/workbooks-opentext-method-excel for the FieldInfo information about fixed width input files. anthonyjr2 1 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
anthonyjr2 Posted July 12, 2018 Author Share Posted July 12, 2018 Doh, I figured there was something like that but didn't see it on the AutoIt help file since it only mentioned stuff about Delimited files. Found what I needed, thanks for the quick reply water. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= Link to comment Share on other sites More sharing options...
water Posted July 12, 2018 Share Posted July 12, 2018 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now