Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Macro - Need to suppress overwrite messages

Posted on 2016-10-27
9
Medium Priority
?
44 Views
Last Modified: 2016-11-23
I have a Macro in Access 2013, it exports results to excel files, I have setup a template, it overwrites the existing files
I have set warnings set to No.

However, it keeps asking about overwriting the file, is there a way to stop this and do it automatically. I need to do it this way as I have one excel file that has references to all the other excel files (collating the results), which have been exported from Access.
0
Comment
Question by:melinhomes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 3

Expert Comment

by:excelismagic
ID: 41861992
did you set ExcelOBject.DisplayAlerts = false
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 41861995
The File Name Argument of the TransferSpreadsheet Macro Action says ...

The name of the spreadsheet file to import from, export to, or link to. Include the full path. This is a required argument.

Access creates a new spreadsheet when you export data from Access. If the file name is the same as the name of an existing spreadsheet, Access replaces the existing spreadsheet, unless you're exporting to an Excel version 5.0 or later workbook. In that case, Access copies the exported data to the next available new worksheet in the workbook.

If you are importing from or linking to an Excel version 5.0 or later spreadsheet, you can specify a particular worksheet by using the Range argument.

ET
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 41862026
You can:

a. Delete the file before.

b. SetWarnings to False in the macro, which should suppress the error messages (don't forget to set it to true again).

Jim.
1
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

Author Comment

by:melinhomes
ID: 41862089
Thank you all for your comments. Jim I have tested this method works a treat. Many thanks!
0
 
LVL 39

Expert Comment

by:PatHartman
ID: 41862560
Be ABSOLUTELY certain to turn warnings back on or you could suffer the consequences.  Having warnings off is so dangerous during development that whenever I turn them off in code to suppress warning messages, I turn the hourglass on.  Then after I turn warnings back on, I turn the hourglass off.  This gives me a visual clue that warnings are off and I must turn them back on.  This prevents an accident should you be testing and stop the code before it completes.
0
 
LVL 75
ID: 41863232
"or you could suffer the consequences."
You *will* suffer consequences :-)
0
 
LVL 39

Expert Comment

by:PatHartman
ID: 41897911
I'm not sure why you awarded points to excelismagic.  This was not an Excel question and so an Excel answer, even if it is correct, would be irrelevant.
1
 
LVL 75
ID: 41898077
Pat is correct. There is no reason for a Split. Jim's answer is the only correct answer per se.
excelismagic's is neither correct nor relevant for this question.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question