2

I have a function that brings up the generic warning when merging two fields together. I want to suppress this message using vba. However after looking on the forums, I found that "Application.DisplayAlerts = True" should do the trick. However when I try to apply the code there is no option for Application. then display alerts. Do i have to import a specific library reference for this? I currently have Excel 14.0 imported..

5
  • Have you tried just putting Application.DisplayAlerts = True in your code? Do you get a compile error when compiling? Commented Oct 29, 2014 at 11:34
  • Yep, I get method or datamember not found and highlights the ".DisplayAlerts = true" Commented Oct 29, 2014 at 11:46
  • If I have a function that brings up the generic warning when merging two fields together. I want to suppress this message using vba, probably you might want to use Application.DisplayAlerts = False. Can you post the part of code which does not compile? Commented Oct 29, 2014 at 14:11
  • Do you get anything after typing Application. ? You say DisplayAlerts isn't there, are any of the following there? Application.EnableEvents Application.CellDragDrop. At a minimum check you have Microsoft Excel 14.0 Object Library checked in References. Commented Oct 29, 2014 at 14:15
  • 14.0 object library is checked. Commented Oct 29, 2014 at 14:37

1 Answer 1

3

I found the resolution myself.

Because Application.DisplayAlerts = False was to set the access program that was calling on my create excel object to ignore any alerts displayed by access. So to solve it I simply wrote objExcel.DisplayAlerts = false

Sign up to request clarification or add additional context in comments.

4 Comments

I am dealing with the same problem but, unfortunately, I was not able to understand your solution. Could you provide more details?
Basically I was using application.displayalerts = false, hoping that it would suppress warnings when doing stuff within an excel workbook when what you actually need to do is just use the instance name of the excel application declaration you're using rather than application.
And how do you declare and set the variable objexcel?
Dim objExcel As New Excel.Application

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.