I have a process that runs all day, gathering data from the web, storing that data on an xlsx file, closing that file, and starting another xlsm book that further process the data while the original process goes back for more collection ( collection of other "parts" of the whole range of data that I gather, hence the reference to 'part' in the code snippet below). Usually I have another unrelated Excel book open in a separate instance of Excel. Say the all-day process is Excel copy 1 and the unrelated work is in 2. When the all-day process uses ShellExecute to start its related function I want and expect that to run in copy 3. Instead, it opens within copy 2 and there are always conflicts between the now unrelated contents of copy 2. Conflicts cause 1004 errors or Excel crashes.
shellexecute Application.hwnd, "open", "C:\users]john\documents\excel\opthistory\histnumber" & part & ".xlsm", vbNullString, vbNullString, SW_HIDE
BTW, I use ShellExecute rather than plain Shell because of the numerous posts about Shell incompatibility with 64-bit. Maybe that conflict can be avoided and Shell would do for me what ShellExecute does not?
Has anyone seen and solved this problem or know how to avoid it?
shellexecute Application.hwnd, "open", "C:\users]john\documents\excel\opthistory\histnumber" & part & ".xlsm", vbNullString, vbNullString, SW_HIDE
BTW, I use ShellExecute rather than plain Shell because of the numerous posts about Shell incompatibility with 64-bit. Maybe that conflict can be avoided and Shell would do for me what ShellExecute does not?
Has anyone seen and solved this problem or know how to avoid it?
Last edited: