UiPath Not Recognizing Text Import Wizard In Excel

Hi friends,

For my program I need to open a txt file through Excel in order to change column format types but when trying to use the text import wizard UiPath does not recognize it. I have tried attach window, anchoring, send hotkey and recording but no luck. I cannot locate the window or click next with UiPath. Any help would be greatly appreciated.
102417_1152_HowtoUsethe1

@kodm

You can give a try with Generate Datatable activity for backend operation

Hope this may help you

Thanks

I also had this issue and solved it with an excel macro that opens the file as wished

That sounds interesting, could you please elaborate on the macro?

Hi @kodm

Hope Computer vision activiites would help you solve this
but i would like to know what is the application used to open that text file

Cheers

Thank you I will try that could you elaborate on that computer vision activity? I am using just Excel.exe, the starting home page of excel and then opening a text file .

Hi @kodm

Fine with excel.exe i was just to trying to open a txt file and access the elements in the text import wizard

Yeah studio is not able to select the elements in that wizard as individual element
but still i can access it and navigate across the fields in that wizard with SEND HOTKEY ACTIVITY with keys like tab, down, up, enter

still considering computer vision in such situation, this would help you

Cheers

I tried hotkeys and it works for choosing the next function but in the text import wizard for the step 3 of 3 when I attempt to change a column from general to text, I must switch between the columns and there is no way of doing that with a hotkey…

Fine

in that wizard where we can change the column format, each word will there with ONE WORD UNDERLINED

for example
G will be underlined in General option
T will be underlined in Text option
D will be underlined in Date

so if we want to navigate that specific radio button we just need to use SEND HOTKEY activity with that specific key and in your case for example mention as “T” in SEND HOTKEY activity so that the cursor will go to TEXT Format option

Cheers @kodm

Fine

in that wizard where we can change the column format, each word will there with ONE WORD UNDERLINED

for example
G will be underlined in General option
T will be underlined in Text option
D will be underlined in Date

so if we want to navigate that specific radio button we just need to use SEND HOTKEY activity with that specific key and in your case for example mention as “T” in SEND HOTKEY activity so that the cursor will go to TEXT Format option

and to navigate across the columns it can be done with right and left keys in SEND HOTKEY activity

Cheers @kodm

Thats our macro code. Maybe you have to adjust it (depending on your selection in filter wizard)

Sub ConvertThroughFilterWizard(inputFilepath As String, targetFilepath As String)
’ Simulate the import wizard
Workbooks.OpenText Filename:= _
inputFilepath, Origin:=437, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=True, Comma:=False, _
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), Array( _
3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), Array(10 _
, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1), Array(16, 1)), _
DecimalSeparator:=",", TrailingMinusNumbers:=True
’ Save as Excel Workbook
Application.DisplayAlerts = False ’ do not mind overwriting a file
ActiveWorkbook.SaveAs Filename:= _
targetFilepath, FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
Application.DisplayAlerts = True ’ but do mind afterwards
ActiveWorkbook.Close
End Sub