- Démarrage
- Didacticiels
- Projets d'automatisation
- Création d'automatisations
- Bases de l'automatisation
- Réf. d’objets
- Meilleures pratiques d'automatisation
- À propos des cibles et des ancres
- Indication d'une cible
- Modification d’une cible
- Tutoriel : Travailler avec l’UI Automation
- Tutoriel : extraction de données de table d’une page Web et modification de ces données dans Excel
- Tutoriel : remplir des formulaires en format PDF avec des données Excel dans Acrobat Reader
- Tutoriel : Création d’un tableau croisé dynamique
- Tutoriel : parcourir les lignes d'une table
- Tutoriel : comparaison des fichiers Excel et envoi par e-mail des erreurs de rapprochement
- Tutoriel : extraire des données d'e-mails automatisés et les déplacer vers une application de bureau
- Tutoriel : Filtrage des données dans Excel
- Tutoriel : Formatage des cellules
- Tutoriel : ajout d’informations sur les fichiers d'un dossier dans un fichier Excel
- Tutoriel : ajout de ses propres formules au Bloc-notes du projet
- Automatisation PowerPoint
- Automatisation des données
- Activités courantes
- Automatisation de l'espace de travail Google
- Automatisation OneDrive et SharePoint
- Résolution des problèmes

StudioX user guide
Tutoriel : ajout d’informations sur les fichiers d'un dossier dans un fichier Excel
Dans ce tutoriel, nous allons créer une automatisation qui permet de récupérer le nom et la taille de tous les fichiers d'un dossier et d'ajouter ces informations dans un fichier Excel.
We will create a project and start by adding a Use Excel File activity to indicate the Excel file to use. We will then add a For Each File In Folder activity to indicate the folder from which to retrieve file information. Inside For Each File in Folder, we will add two Write Cell activities, one to copy the name, the other to copy the size of each file to two cells in the Project Notebook. We will finish by adding an Append Range activity that appends the two cells to a range in an Excel file after the cells are populated for each file.
- Configurez un projet et créez un fichier Excel dans le dossier du projet.
- Create a new blank project using the default settings.
- Créez un fichier Excel dans le dossier du projet et nommez-le fichiers.xlsx.
- Ouvrez le fichier nouvellement créé dans Excel et entrez le texte
File Namedans la cellule A1 et le texteFile Sizedans la cellule B1. - Enregistrez et fermez les fichiers.xlsx.
- Ajoutez le fichier Excel au projet et indiquez le dossier dont les fichiers peuvent être parcourus.
-
Dans le panneau Activités de StudioX, sélectionnez l’onglet Excel, puis double-cliquez sur Utiliser un fichier Excel. Une activité Utiliser un fichier Excel est ajoutée au panneau Concepteur.
-
Dans l’activité Utiliser un fichier Excel :
- Click Browse
next to the Excel file field, and then browse to and select the file files.xlsx. - Dans le champ Référencer en tant que, entrez
NamesSizes.
- Click Browse
-
Dans le panneau Activités, sélectionnez l’onglet Fichier, puis faites glisser l’activité Pour chaque fichier du dossier et déposez-la à l’intérieur de l’activité Utiliser un fichier Excel.
-
In the For Each File in Folder activity, click Browse
next to the In folder field, and then browse to and select a folder on your computer which contains files, for example the Desktop.
-
- Copiez les informations sur les fichiers vers le fichier Excel.
-
Dans le panneau Activités, sélectionnez l’onglet Excel, puis faites glisser une activité Écrire la cellule et déposez-la à l’intérieur de l'activité Pour chaque fichier du dossier.
-
Dans l’activité Écrire la cellule (Write Cell) :
- Click Plus
on the right side of the What to write field, and then select CurrentFile > Name to indicate that we want to copy the name of the current file in the iteration. - Click Plus
on the right side of the Where to write field, and then select Notebook > Indicate in Excel to open the Project Notebook. In the file, select the A1 cell in the Scratchpad sheet, and click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to paste the name of the current file in the iteration to cell A1 in the Scratchpad sheet of the Project Notebook.
- Click Plus
-
Ajoutez une deuxième activité Écrire la cellule en dessous de la première activité.
-
Dans l’activité Écrire la cellule (Write Cell) :
- Click Plus
on the right side of the What to write field, and then select CurrentFile > Size to indicate that we want to copy the size (in bytes) of the current file in the iteration. - Click Plus
on the right side of the Where to write field, and then select Notebook > Indicate in Excel to open the Project Notebook. In the file, select the B1 cell in the Scratchpad sheet, and click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to paste the size of the current file in the iteration to cell B1 in the Scratchpad sheet of the NamesSizes Excel file.
- Click Plus
-
Pour rendre les deux activités Écrire la cellule plus facilement identifiables, modifiez le nom dans la barre supérieure de chacune d’entre elle. Par exemple, utilisez
Write Cell Namepour la première activité etWrite Cell Sizepour la seconde. -
Dans le panneau Activités, faites glisser une activité Ajouter la plage et déposez-la à l’intérieur de l'activité Pour chaque fichier du dossier en dessous de la deuxième activité Écrire la cellule.
-
Dans l’activité Ajouter la plage (Append Range) :
-
Click Plus
on the right side of the Append after range field and then select NamesSizes > Sheet1. -
Click Plus
on the right side of the Excel range to append field, and then select Notebook > Indicate in Excel to open the file in Excel. In the file, select the A1:B1 cells and click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to add the information about the current file in the iteration to columns A and B in the NamesSizes file after the existing data in the file.
-
-
Cliquez sur Enregistrer dans le ruban StudioX pour enregistrer l’automatisation, puis cliquez sur Exécuter pour exécuter l’automatisation.
The name and size of each file in the indicated folder are copied one by one to cells A1 and A2 in the Scratchpad sheet of the Project Notebook, and then appended to files.xlsx.Download example
-