ExcelPupper
Board Regular
- Joined
- Mar 2, 2020
- Messages
- 112
- Office Version
- 2019
- Platform
- Windows
Hi, I have here a message prompt everytime I run my code below.
Is there a way to add a line of code that clicks the "No" button so it won't prompt again next time I run this code?
VBA Code:
Sub DataDownload()
'
'Copy downloaded data from product costing system
Dim lr As Long
Workbooks.OpenText Filename:="C:\Temp\DataDownload.xls", Origin:=437 _
, Startrow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=True, Comma:=False, _
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), Array( _
3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), Array(10 _
, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1), Array(16, 1), _
Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), Array(22, 1), Array( _
23, 1), Array(24, 1)), TrailingMinusNumbers:=True
lr = Range("A" & Rows.Count).End(xlUp).Row
Range("A1:X" & lr).Select
Selection.Copy
Windows(ThisWorkbook.Name).Activate
Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteValues
Workbooks("AccountingDownload.xls").Close SaveChanges:=False
End Sub