Open an Excel file with a macro.
Code:
Sub open_excel_file()
'how to open an Excel file
Dim current_file As Workbook
Dim path_current_file As String
'open file from written path
Set current_file = Application.Workbooks.Open("C:\Users\brunduk\Documents\Tutorials\Test file.xlsx")
'open the file using a variable for the path
'path_current_file = "C:\Users\brunduk\Documents\Tutorials\Test file.xlsx"
'Set current_file = Application.Workbooks.Open(path_current_file)
'open the file using a variable for the path - with path written on a cell
'path_current_file = ActiveWorkbook.Worksheets(5).Cells(1, 1)
'Set current_file = Application.Workbooks.Open(path_current_file)
End Sub
-------------------------------
THANK YOU
-------------------------------
For watching my videos,
Your shares
And your comments!
-------------------------------
CONTACT ME
-------------------------------
Send your messages (questions, training requests or creation of files): https://www.kevinbrundu.com/contact/
Stay informed: https://kevinbrundu.com/en/homepage
-------------------------------
ONLINE COURSES
-------------------------------
Find all the news and links of my online courses on my website https://kevinbrundu.com/en/homepage
-------------------------------
SOCIAL NETWORKS
-------------------------------
Website: https://kevinbrundu.com/en/homepage
LinkedIn: / k%c3%a9vin-brundu-9a910241
Facebook: / kevinbrunduauteur
-------------------------------
MERCI
-------------------------------
De regarder mes vidéos,
Pour vos partages
Et vos commentaires !
-------------------------------
RENDEZ-VOUS SUR MON SITE INTERNET
-------------------------------
https://www.kevinbrundu.fr/
Retrouvez y :
Des fichiers Excel à télécharger gratuitement
Mes formules clés en main sur Excel avec des fichiers prêts à l'emploi
Mes services de Consultant Optimisation, Performance et Génération d'idées
-------------------------------
AUTRES RESSOURCES EN LIGNE
-------------------------------
Livres publiés : https://www.amazon.fr/Kévin-Brundu/e/...
Cours en ligne sur Udemy :
VBA Macro Excel - Formulaire simplifié sur une feuille Excel https://www.udemy.com/course/macro-ex...
VBA Macro Excel - Compiler des fichiers dans un seul tableau https://www.udemy.com/course/macro-ex...
Suivez toutes les actualités sur mon site internet directement.
-------------------------------
DES QUESTIONS ?
-------------------------------
Laissez vos questions en commentaires ou contactez-moi directement via mes réseaux sociaux.
-------------------------------
RESEAUX SOCIAUX
-------------------------------
Pour en savoir plus sur moi et me contacter :
Site internet : https://www.kevinbrundu.fr/
LinkedIn : / k%c3%a9vin-brundu-9a910241