Things that interfere with VBA Macros
Ok, so here is grey area that I was wanting clearing up.
What system wide events will have a direct effect on VBA macros that are running within Excel?
For instance I know that if you open any Excel workbook, whilst holding down the shift key it stops the Auto_Open() macro from running.
In my application I have a 'Summary' workbook, that opens many many other Excel workbooks, extracts information from them, and then closes them again, so before each 'Workbooks.Open' command I have an API based macro that tests the state of the shift key, and if it is depressed waits until it is released before opening the 'child' workbook.
However, even with this in place sometimes my macro will just stop for no apparent reason (usually with one of the child workbooks open).
I generally leave the main workbook running it's macro in the background on the PC whilst I do something else as it takes a long time to process, so I'm wondering what other key presses or operations I might be doing that would cause the macro to stop.
When Excel copies a range in a macro and attempts to paste it into another sheet it uses the default Windows Clipboard.
If by some gross mistiming I manage to copy some text from a report I am writting (for instance), AFTER Excel performs it's COPY command, but before it processes the PASTE command, I effectively overwrite the data it copied, and cause it to then paste the text that I copied from the report into the Excel spreadsheet rather than the data it intended to copy.
When using the ".Copy Destination:=" format Excel is safe in pasting the data it copied, but it will still destroy anything that might already be on the Windows Clipboard.
Is there anything else I should be aware of?
Ideally I would like to be able to start my macro and then have Excel running as an isolated process, protected from anything else I am doing on the PC (when Excel does not have Focus), but that doesn't seem to be the case.
Last edited by Phil_V; 06-09-2009 at 05:44 AM.
Reason: Clearing up examples
If you find the response helpful please click the scales in the blue bar above and rate it
If you don't like the response, don't bother with the scales, they are not for you
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1