file open antivirus conflict
RH

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » File Open Antivirus Conflict, File Save Antivirus Conflict

File Open Antivirus Conflict, File Save Antivirus Conflict

resolvedResolved · Medium Priority · Version 2007

Mike has attended:
Excel VBA Advanced course

File Open Antivirus Conflict, File Save Antivirus Conflict


I have an issue with a file open, save & close, conflict with the antivirus software on the PC, which is Kaspersky Anti-Virus 2012.
Randomly when manually performing a file open, save or close a Microsoft dialogue box will appear saying “The file is in use by another user” cancel the message & try again and it opens / saves / closes ok.
But with an Excel macro running, using the standard file open, save or close command, it puts up the message box and then prompts the user to “End” or go to “Debug” which results in the macro not completing.

What I need is a method to detect the message code, then to pause and retry the operation. If I use On Error, this is a catch all, I only want to pause & Try again if it is the specific error message.

As this is a random occurrence, albeit quite frequent, it is very difficult to test any code changes.

Environment:
I get this with Office 2007 & 2010 on both Vista Business & Windows 7 Pro the common factor is the Kaspersky both the latest version & previous version, I have in the previous version of Kaspersky excluded checking of Office files which cured the problem, but for obvious reasons am not keen to leave the antivirus disabled for Office files.

RE: File Open Antivirus Conflict, File Save Antivirus Conflict

Hi Mike

Thanks for your post.

I will run this by one of my colleagues but quite tricky to analyse the issues without first hand access to your files running in your IT environment.

This forum is more for assisting with questions related to attended training and where possible code related questions.

However this forum has a significant user community and there is a possibility that someone else may have experienced similar issues to you and have found a way round the problem.

Kind regards

Jacob

RE: File Open Antivirus Conflict, File Save Antivirus Conflict

Hi Mike, thanks for your query. It's very difficult to walk you through how to sort this problem out on this forum, so I want to give you a few key points to explore.

If you can't code your way round a dialog box/error message which is being fired by a software conflict, consider doing the coding equivalent of spotting the error message, capturing it and sending a key press to that box. You will need to use the Windows API to do this. You will also need to investigate how to the find the "handle" of a particular form that appears, the unique ID of the button on that form and then sending the equivalent of a mouse click to it. Note this is not the same as using the Sendkeys function. You may also need to involve the timer to, say, check every five seconds if that form has appeared, or alternatively the Do Events command to hand the focus back to the user while all this is occuring.

This is achievable and usually employed in complicated (and rather "patchwork") tools to release the user from having to sit through a macro for 15 mins waiting for one box to appear for them to click. This link should give you some pointers:

http://scriptorium.serve-it.nl/view.php?sid=44

Hope this helps,

Anthony

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Sum Up All the Values in A Column

If you want to quickly calculate the Summed values of all cells in a column in Excel 2003 normally you would use the SUM formula. (eg if you wanted to calculate the values in Column C rows 10 to 25) the formula would be:

=SUM(C10:C25)

However, if you keep adding values to column C you would keep having to modify the above SUM formula which can get quite annoying.

To get around this you can sum all the values in a column using the following formula:

=SUM(COLUMN:COLUMN)

Which, in our example, would be:

=SUM(C:C)

NOTE You cannot place this formula in column C, or else Excel 2003 will show a circular reference error.

The formula must be placed in any other column, EXCEPT the one being calculated.

View all Excel hints and tips


Server loaded in 0.05 secs.