Open a Xlsx Excel and run certain macro

Hello Guys :slight_smile:

I want to open a certain xlsx file and then run a certain makro in that opened file.
What activity do I use and how?

Thanks :slight_smile:

Hi @SSchmitz,

use Excel Application Scope activity, and Execute Macro in it:

image

1 Like

Thanks! Now I need to enter the last months ultimo and todays date. Whats the way to get those values?

@SSchmitz,
Do you want to colect the date from this table?

The date today can be used as a variable:

today = Today.ToString("yyyy-MM-dd")

1 Like

I need to enter the last months ultimo and then then hit OK. After that the file which includes the “Dateiname” as Filename and is found in Path (“Pfad”) has to be send to a certain mail adress.


@Adrian_Star

@SSchmitz
You can use something like this:

Variables:
now (variable type: DateTime)
whichDay (variable type: Int32)
newDate (variable type: DateTime)

Logic
now = DateTime.Now
whichDay = now.Day

newDate = now.AddDays(-whichDay)

Function explanation
DateTime.Now shows today’s date
.Day shows you which day it is
.AddDays(1) adds the number of days = 1
.AddDays(-1) subtracts the number of days = 1

1 Like

Great explantion. So you pretty much do: Date-Day from today. Thanks alot! Very helpfull!

1 Like

@SSchmitz,

This is the simplest method because logic is stitched in the UiPath Studio library.

image

1 Like

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