I tried looking this over the Internet (also on SO) but did not find any solution.
I am looking for a way to get a filename of opened XML. My code opens like this:
Workbooks.OpenXML FileName:=pliczek, LoadOption:=xlXmlLoadImportToList
Variable pliczek
is path of file and when code is executed new file is opened for example Sheet1
. I want to know filename - I want to execute some code on it but no idea how to get this name.
Trying to activate next windows is risky if someone has more excel files opened.