Solved

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

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What's wrong with CopyFromRecordset 6 33
Dcount using a date in a table compared to today's date 3 30
User Level Security 6 38
Reference Controls on subforms 7 28
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

770 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