Display alert ignored

webdevptg

Board Regular
Joined
May 2, 2019
Messages
51
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. Web
Hi,

I have a procedure created that will update an excel table in a different book, everything is working perfectly, but I wanted no message to be presented to users.
I am using the display alert = false, but there are still 2 messages I wanted to avoid (message attach post), the one to delete lines and the one to paste values.


VBA Code:
....

Application.ScreenUpdating = False

Application.DisplayAlerts = False

if numberRecord > 0 Then
             wbTarget.Worksheets("DataBase").ListObjects("GlobalData").Range.AutoFilter Field:=2, Criteria1:=strCriteria

            wbTarget.Worksheets("DataBase").ListObjects("GlobalData").DataBodyRange.SpecialCells(xlCellTypeVisible).Delete
End If


wsSource.Range("A5:P44").SpecialCells(xlCellTypeVisible).Copy


wbTarget.Worksheets("DataBase").Range("C" & lastRow).PasteSpecial Paste:=xlPasteValues


Application.DisplayAlerts = True
Application.ScreenUpdating = True
 

Attachments

  • Picture2.jpg
    Picture2.jpg
    91.7 KB · Views: 13

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Insert the extra text into this line
Rich (BB code):
wbTarget.Worksheets("DataBase").ListObjects("GlobalData").DataBodyRange.SpecialCells(xlCellTypeVisible).EntireRow.Delete
AND
HAve you ticked the box "Do not show this again" ?
 
Upvote 0
Insert the extra text into this line
Rich (BB code):
wbTarget.Worksheets("DataBase").ListObjects("GlobalData").DataBodyRange.SpecialCells(xlCellTypeVisible).EntireRow.Delete
AND
HAve you ticked the box "Do not show this again" ?

H,

msg delete
With the line above shows the error 1004: "This won't work because it would move cells in a table on your worksheet" (attach msg error)

msg paste
Regarding the information message of the paste values line, the user can always activate the option "Do not show this again", but I would like it to never appear
 

Attachments

  • Imagem1.png
    Imagem1.png
    39.3 KB · Views: 3
Upvote 0
I found the solution


VBA Code:
wbTarget.DisplayAlerts = False

....

wbTarget.DisplayAlerts = True
 
Upvote 0
I found the solution

I certainly don't think so. You should have fixed something else somewhere else in your code. DisplayAlerts is not a workbook object property but an Application property. Your code must fail on that line, unless you are ignoring the errors in your code.
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,980
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top