Hello everybody,
I have a problem with the following macro:
Sub get_f_data()
Dim path As Variant
Dim excelfile As Variant
path = "C:\Users\me\Desktop\get_f_data\"
excelfile = Dir("*.xls")
Do While excelfile <> ""
Workbooks.Open fileName:=path & excelfile
Call project_capacity
Call electricity_production
excelfile = Dir
Loop
End Sub
It's an xlma file that I launch from the Excel task bar. It opens all workbook in the folder get_f_data and launches the procedures project_capacity and electricity_production.
Sometimes it's working fine, and sometimes when I click on the button in the taskbar that is linked to the xlma nothing happen. I have no error message but nothing happen, no file is opened.
Sometimes after opending different files and running other macros, this macro tries to open files outside the designated folder.
Could you please help me with this? Does anybody have an idea on why it's not working sometimes?
Thank you for your help;
Bookmarks