How to read script from Textbox inside excel sheet and paste into portal

Good afternoon folks,

I need better suggestion for following scenario.

In attached snap - script is available into Textbox 1. which about more than 2k number of lines.
I have to copy this script and paste(Typeinto will take time to type 2k + lines) into sql.

Please suggest…!!

@Palaniyappan
@HareeshMR
@AshwinS2
@rmunro

Is it possible to share the workbook @prashantP?

Please try using SetText activity.

good morning @HareeshMR

I can not share you actual file.
But I have created sample file which is attached here.
samplefile.xlsx (26.6 KB)

please note that -

  • if you found solution without opening file copy the script will be great because that file size is more 50 mb and it is taking time to open.
  • also while entering data " typeinto " will take time to type 2k lines script. so better to use paste copied script kind of thing.

please let me know if anything required.

Thank you.

Hi @san.nagane
Thank you for looking into it.

Yes Settext is good one…:+1:

can you please suggest for copy script from excel textbox.

Waiting for response.

@HareeshMR
@san.nagane
@Palaniyappan
@loginerror
@AshwinS2
@rmunro

Sorry for the delay in response
Copy the string and using set to clipboard activity will do that much faster
Cheers @prashantP

thank you for response @Palaniyappan

How to copy that string ? what activity should i use to copy that script. ?

Also please let me know how to write protected(enable editing) cell ?

Waiting for your response guyz.

@HareeshMR
@san.nagane
@Palaniyappan
@loginerror
@AshwinS2
@rmunro

Hi @prashantP

Use click activity and use set to clipboard activity
Thanks
Ashwin.S

Hi @AshwinS2.
Good morning.

I am not getting it.

possible to create sample xaml ?
samplefile.xlsx

thanks

Hi,

Please refer the sample workflow attached to copy the data from textBox from Excel.
Main.xaml (8.9 KB)

Hi @poojajoshi1

thank you for helping.

activity is showing missing.
colud u please update the same.

image

Hi,
Please refer the below.

You can try it yourself.

Regards,
Pooja

1 Like

@poojajoshi1

in this scenario excel file should be open right ? to open need to use start process right ?

my question is it possible to copy without opening excel because excel file is taking time to open.

please suggest

Thanks.

I don’t think so it is possible to do it from background. Even if it takes time to open excel file you can use on element appear activity to wait for it to completely load and then carry out the above activities.

Regards,
Pooja

The above solution will work but it has to open the workbook. If you are not willing to do that, VB code will be an another option. Try this code and let me know if this helps @prashantP

    Dim excel As Microsoft.Office.Interop.Excel.Application
    Dim wb As Microsoft.Office.Interop.Excel.Workbook
    Dim ws As Microsoft.Office.Interop.Excel.Worksheet
	excel = New Microsoft.Office.Interop.Excel.Application
	wb = excel.Workbooks.Open("D:\UiPath\CopyAndPasteInExcel\samplefile.xlsx", [ReadOnly]:=False)
    excel.Visible = True
	ws = CType(wb.Sheets("SSMS Script"), Microsoft.Office.Interop.Excel.Worksheet)
    ws.Activate()
	Dim str As String = ws.Shapes.Range("TextBox 1").AlternativeText
	system.Windows.MessageBox.Show(str)
	wb.Close
	excel.Quit

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.