[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Embedded Excel Object in Access97: Delete Sheets via VBA without Alerts

Posted on 2004-10-20
3
Medium Priority
?
488 Views
Last Modified: 2012-08-13
Hello everybody,

what I'm trying to do:
In an Access97 Form I have an embedded Excel object. I'm trying to delete all but one sheets with VBA without the alert "Do you really want to delete...".

I tried objExcel.Application.displayalerts=false
and
DoCmd.SetWarnings False

but both won't stop the alert.

Can anybody help me?

Thanks
Chris
0
Comment
Question by:Chrising
[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
3 Comments
 
LVL 7

Assisted Solution

by:SQL_Stu
SQL_Stu earned 750 total points
ID: 12355991
The below code works in Excel 2000:

Application.DisplayAlerts = False
Sheets("Sheet1").Delete
Application.DisplayAlerts = True
0
 
LVL 27

Accepted Solution

by:
jjafferr earned 750 total points
ID: 12356120
Hi Chrising,

4 ways to do this:
1- If you want to stop ALL of these messeges in your mdb, then
Menu Bar > Tools > Options > Edit/Find and remove all the 3 ticks.

2- If you want to stop the error messeges in a particular code.
docmd.SetWarnings (false)
'code
docmd.SetWarnings (true)

3&4-
other way is to change docmd.runSQL "insert into ....." or docmd.openquery "qAppMyAppendQueryName"

Currentdb.execute "insert into...."
or
currentdb.execute "qAppMyAppendQueryName"

Hope this helps

Jaffer
0
 
LVL 1

Author Comment

by:Chrising
ID: 12378340
Hi All,
these are both not the solutions I needed, but since I found a workaround (I delete all data oin the specific sheets), I'll split the points.

I needed to turn of Alarm of an embedded Excel Object in an Access form, so the docmd... wouldn't have any effect and the displayalerts property isn't available in an Excel object on an Access form.

Greetings Chris
0

Featured Post

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.

Question has a verified solution.

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

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…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

656 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