Disabling Message alerts

KeythStone

New Member
Joined
Mar 30, 2011
Messages
36
Hello and Thanks to All,

I am trying to auto publish files with some having date stamps in the file name and others which are replacing old files. My trouble comes in when I want to replace a file. It asks if I want to replace the file (Same name). Yes, to answer the questions. But really, I want this process to be automated and so I'm left thinking how can I:

1. Disable the message alerts so that it will automatically replace the older file with confirmation from the user.

2. Us a program to basically click "Yes" automatically.

What program would i be using? ClickYes?
How do I go about this?

Thanks again,
KeythStone
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Is this part of the Access project you are working on?

If so, you can shut off the warnings.
In Access Macros, it is the SetWarnings command (set to "No").
In Access VBA, it would look like:
Code:
DoCmd.SetWarnings False
 
Upvote 0
Based on your previous thread from today, I assumed this was an Access question and move it to the appropriate forum. If it is not, please let me know and I will move it to wherever it needs to go.
 
Upvote 0
To All,

Actually I had posted to that forum b/c it pertained to Microsoft Windows Exploerer settings at large, not an Access application delimma.

When I am saving to a shared network drive folder and want to replace a file I'd like not to have to deal with the "Confirm File Replace" message question that pops up. Reason being that I am automating this publication process.
Some files I will date stamp, as some gracious folks helped out with earlier. There are other files which will simply be replaced.

Question include:
Will I hit that message if I automate the publishing process?
Can I get around the message?
Is there a program which auto clicks on "yes" every time I want it to do so?
What else can I do to successfully publish/replace a file automatically without Windows asking if I DO want to replace the file.

Thanks,
KeythStone
 
Upvote 0
How do you plan to automate the publication process?
What program do you intend to use (Access, batch files, VB Scripting, etc)?

I think whatever program you intend to use to build the "automated process", that is where you would need to "handle" the alerts.
If you want to use Access, the method I gave you should work. Otherwise, let us know which program you intend to use.
 
Upvote 0
Yeah,

So I'm using Access.
In the Macro, I set Message Alerts to No.

Message still pops up, making me think that it's not a message from Access but from my OS; Explorer or something.

I've done some research online: How to disable message alerts such as this one (Confirm File Replace, Do you want to replace this file? Yes, Cancel). To no avail...

And here we are :)

Thanks,
KeythStone
 
Upvote 0
Sometimes it depends on the method that you are writing/saving the file (sometimes there are optional arguments that you can set in the function itself to avoid these).

What exactly does the code you have that saves/overwrites the file look like?
 
Upvote 0
How about this in VBA:
Code:
Dim strFile As String
 
strFile = "C:\FolderName\FileName.xls"
If Dir(strFile) <> vbNullString Then
   Kill strFile
End If

And then do the publish.
 
Upvote 0
When saving a file with date stamp:

Dim StrDocIPC As String
StrDocIPC = "F:\OP_CS\Client Reporting\TEST\ipc_" & Format(Date, "yyyymmdd") & ".pdf"
DoCmd.OpenReport "AIM (Assignment,DB)_IPC", acViewPreview, "", "", acIcon
DoCmd.OutputTo acOutputReport, "AIM (Assignment,DB)_IPC", "PDFFormat(*.pdf)", StrDocIPC, False, "", 0, acExportQualityPrint
DoCmd.Close acReport, "AIM (Assignment,DB)_IPC"

When saving a file to replace:

DoCmd.OpenReport "AIM (Assignment,DB)_UPDINS", acViewPreview, "", "", acIcon
DoCmd.OutputTo acOutputReport, "AIM (Assignment,DB)_UPDINS", "PDFFormat(*.pdf)", "F:\OP_CS\Client Reporting\TEST\updins.pdf", False, "", 0, acExportQualityPrint
DoCmd.Close acReport, "AIM (Assignment,DB)_UPDINS"

I haven't begun modifying the second set of code to account for "replacing a file with same name," it's just my usual output_to code.

Thanks,
KeythStone
 
Upvote 0
boblarson: Thanks i used that code segment and it works. I don't get a confirmation message anymore.
To all: Thanks again for all your help
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,270
Members
452,902
Latest member
Knuddeluff

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