You have to refer to the application that has the program open.
Windows(windowname).Activate would only activate a window within the
active application, which will normally be Excel. See info at the link
below on accessing other programs from within Excel,
http://www.exceltip.com/st/Basic_inf...Excel/462.html
On Jun 23, 11:19 am, AndyC812
wrote:
Hi,
I'm trying to close a particular Word file from Excel without saving
changes. I have the full path to the file in TempFileName variable, this is
what I tried but it is giving me a "subscript out of range" error:
Windows(TempPathName).Activate
ActiveWindow.Close
--
Thanks,
Andy