mazlumkacar
(mazlum kaçar)
December 20, 2019, 7:20am
1
Hi all,
I need to add all borders to my excel page. i can do it with start process and excel or with excel pplication scope. But i cannot do it.
I have try to do it as Alt+H+B+A shortcut but i have noticed that uipath cannot run Alt+H shortcut in excel. How can i do that?
2 Likes
@mazlumkacar
You can try using VBA Macro .
I have done using invoke vba activity.
Thanks!
2 Likes
mazlumkacar
(mazlum kaçar)
December 20, 2019, 7:41am
3
but how may i do that? can you share your code?
1 Like
Use the below code, copy and paste it in a notepad file.
Then use “Invoke VBA Activity”.
Set the Vba text file path.
Change the “Main” name to “Macro1” that we have used in below code.
Sub Macro1()
Worksheets(“Sheet_name”).Range(" ").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.BorderAround ColorIndex:=1
End Sub
thanks!
mazlumkacar
(mazlum kaçar)
December 20, 2019, 8:04am
5
Thanks a lot. But i am getting this error:(
@suruchi120294
Have you enabled the macro settings in excel application?
can you share the screenshot of your Invoke activity?
Just check on " enable all macros" option or else your macro won’t run.
Thanks!
mazlumkacar
(mazlum kaçar)
December 20, 2019, 8:15am
9
i did it but getting excatly the same error:(
Should i change something in my macro code?
mazlumkacar
(mazlum kaçar)
December 20, 2019, 8:58am
10
Is that yellow fill color mean this code is wrong ?
@suruchi120294
@Palaniyappan
1 Like
Hi this would actually work
Use small case of h b and a
The sequence will be like this
—use START PROCESS activity and pass the file path of excel as input which will bring the file to foreground
—then use send hot key activity without any selector chosen and use hot key as alt+h
—then another send hot key with key as b
And final hot key with key as a
Cheers @mazlumkacar
Yes you have to change the Sheetname you are having in the excel file with the specified range that you have to put border to.
Thanks!
mazlumkacar
(mazlum kaçar)
December 20, 2019, 10:28am
13
i have just try to do it but it is getting error. Mayi would like to you write it for me?
sheet name is “Sheet1”
range is all columns that has data.
@suruchi120294
Palaniyappan
(Palaniyappan P )
December 20, 2019, 10:39am
14
Fine
The steps involved will be like this
—use START PROCESS activity and mention the file path of excel as input
—now this will bring the excel to foreground
—then use a SEND HOT KEY activity and mention the input as ctrl+g
—now use a TYPE INTO activity and mention the input as “A1”
—then use a SEND HOT KEY activity with key as ctrl+A
—now send hot key with key as alt+h
—another send hot key with key as “b”
—final send hot key with key as “a”
It worked when I tried to simulate
Cheers @mazlumkacar
4 Likes
mazlumkacar
(mazlum kaçar)
December 20, 2019, 11:14am
15
Perfect solution. Thanks buddy. @Palaniyappan
1 Like
balupad14
(Balamurugan (BalaReva))
December 20, 2019, 12:34pm
17
Hi all.
I knew it fixed by @palaniyappan . Here is an activity called “Set Border” to set border to the range or a cell.
Hi,
I have developed a new activity to set the border to the range or cell inside the workbook.
[image]
Properties :
[image]
Detail of the properties
Presets :
[image]
Line Style :
[image]
Border Color :
You can set the color like .“Color.Red”.
Border weight :
you can specify the border weight like 4.
Thank you
Balamurugan.S
Regards
Balamurugan.S
2 Likes
system
(system)
Closed
December 23, 2019, 12:35pm
18
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.