Dileep Reddy
Member
Hi,
I have written a vba code to loop through all files and do some specific work. However I am not able to open one file (Attached) through vba and hence its throwing me an error. But I can open this Excel file by double clicking on the file. May be because the file contains special character but the client is saying that if we can open the file using normal excel, why can't you do the same through macro.
I am using the below code in my workbook
'Target File Extension (must include wildcard "*")
myExtension = "*.xlsx"
'Target Path with Ending Extention
myFile = Dir(mySrcPath & myExtension)
'Loop through each Excel file in folder
Do While myFile <> ""
'Set variable equal to opened workbook
Set wb = Workbooks.Open(Filename:=mySrcPath & myFile)
Can you please help?
Thanks in advance.
Dileep
▬▬▬▬▬▬▬▬▬ Mod edit : thread moved to appropriate forum !
I have written a vba code to loop through all files and do some specific work. However I am not able to open one file (Attached) through vba and hence its throwing me an error. But I can open this Excel file by double clicking on the file. May be because the file contains special character but the client is saying that if we can open the file using normal excel, why can't you do the same through macro.
I am using the below code in my workbook
'Target File Extension (must include wildcard "*")
myExtension = "*.xlsx"
'Target Path with Ending Extention
myFile = Dir(mySrcPath & myExtension)
'Loop through each Excel file in folder
Do While myFile <> ""
'Set variable equal to opened workbook
Set wb = Workbooks.Open(Filename:=mySrcPath & myFile)
Can you please help?
Thanks in advance.
Dileep
▬▬▬▬▬▬▬▬▬ Mod edit : thread moved to appropriate forum !
Closed as duplicate !