Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

738 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