Solved

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

Posted on 2004-10-20
3
433 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
3 Comments
 
LVL 7

Assisted Solution

by:SQL_Stu
SQL_Stu earned 250 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 250 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now