Actually, "Workbooks.OpenText" seems to be similarly broken, pretending that the file does not exist, while "line input" works fine with exactly the same list of filepaths, filenames and extensions - which means that I will have to change many macros.
Importing ASCII text files with extensions other than .txt or .csv
To open an ascii text file with a file extension other than .txt or .csv, in EXCEL 2019 under Windows I can define the desired extension in the "File name" input field. This field seems not to exist in the EXCEL 2019 for Mac. Neither the "Open File" nor the "Import" dialog allows to open a file with a different extension by selection or even to copy or type in the desired file name. Is there any way around this limitation?
Microsoft 365 and Office | Excel | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
8 answers
Sort by: Most helpful
-
Anonymous
2020-07-30T20:26:42+00:00 -
Anonymous
2020-07-31T00:16:15+00:00 One if/else statement can be added to check the availablity of the file but yes, many macros need to changed.
-
Anonymous
2020-07-31T04:24:43+00:00 The files definitely are there, but similarly to the "Open File" dialogue of EXCEL, "Workbooks.OpenText" will no longer accept these, presumably because they do not carry the ".txt" extension. These are macros that I have been using routinely for many years.
While for single files it does not make much of a difference to read them line by line, this method is significantly slower than the "Workbooks.OpenText" method, which makes it very tedious when hundreds of files have to be opened to extract relevant information.
Actually, I only noticed the problem with the "Open File" dialogue in EXCEL because I wanted to record a macro using this dialog for comparison to find out why the "Workbooks.OpenText" method stopped working in EXCEL 2019 despite my doing everything "by the book" https://docs.microsoft.com/en-us/office/vba/api/excel.workbooks.opentext