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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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

Forum statistics

Threads
1,214,965
Messages
6,122,495
Members
449,088
Latest member
Melvetica

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