Excel formatting issue

How, can we align the excel with full data. @Palaniyappan @lakshman

1 Like

Kindly elaborate a bit more pls
Cheers @balkishan

@balkishan

Could you please tell more details about the issue for better understanding.

Awesome
So use a Start process activity and pass the filepath of excel as input to Filename property
—this will open the excel in foreground and use a Send hot key with key as ctrl+g and use type into activity with input as “A1”
—again a send hot key with key as ctrl+a
—and one more send hot key with key as Alt + h then and then a hot key as A and final one with key as C

So
Totally

Hot key - Ctrl+g
Type into with A1
Hot key - Ctrl+a
Hot key - Alt + h
Hot key - a
Hot key - c

Cheers @balkishan

2 Likes

@balkishan

Create one Excel template file with predefined column types and format and keep it in one folder. Whenever you want to write data then just copy this template file into other folder and then write data into it.

I don’t want to open the excel file bro. I want to do this in without opening the excel.

1 Like

Then we can do that with Macro
For that in excel itself under VIEW option click on Macro and click on Record Macro
Do all the manual steps that will align to centre which will recorded as a vb script in background
Then pause the macro
—then click on Macro option again and click on view Macro and edit option
—this will open the vb script page
—copy that script and paste it in a text file
—now pass that text file path as input or INVOKE VBA activity with Macro name as property

Cheers @balkishan

1 Like

Hi @balkishan,

you can try this one . it has feature all the feature like below.

Regards
Balamurugan.S

2 Likes

I recorded the macro, and calling the code text file and storing in a variable.
Next tell me what I have to do.
In the Invoke VBA I didn’t see which option you told me.

where you told me to pass the text file var in input which activity input ??

@lakshman @KarthikByggari suggest please

1 Like

@balkishan

Have you tried Format Cells activity developed by @balupad14. If not then try with that activity first. You no need to create any macros and run it separately.

Other alternative is to create one template excel file and follow the steps as mentioned in my previous post.

1 Like

sorry that was my mistake…
we need to pass the filepath of the macro text file to INVOKE VBA and mention the function as method name
here in
image

keep this invoke vba inside the excel application scope

Cheers @balkishan

1 Like

HI ,
I have attached a sample to get clear idea in the below. I will solve the issue.

Regards
Balamurugan.S

sorry I didn’t get this function name as method name? which function name?

1 Like

Fine
in your macro text file in the first line of it
sub macro1() \\some name will be there right
that is what we need to mention in the method name

Cheers @balkishan

1 Like

is it the right way ?
I give my macro name in place of Main

My macro text file
image

1 Like

in your excel setting, check the Trust access to the VBA project object model , under Macro Settings in Options .

Cheers @balkishan

2 Likes

Hi Palani thanks it worked. I want to know one thing. Suppose If no excel is installed on the server, OR Macro is not installed in the Excel will this work ??

hmm we can use invoke vb script activity
but not sure how far it would work
@balkishan

1 Like

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