Solved

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

Posted on 2004-10-20
3
448 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

896 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

11 Experts available now in Live!

Get 1:1 Help Now