excel automation and SendKeys "%{ENTER}", True

  • Thread starter trevorC via AccessMonster.com
  • Start date
T

trevorC via AccessMonster.com

Hi All,

I am trying to automate setting up an excel report based on access data, this
is done from access using automation. I use the code below to get Outlook to
continue and automatically send the email, without sendkeys it waits for the
user to select continue.

(Trimmed)
With MailOutLook
.To =
.Subject = "Weekly Status Report"
.Attachments.Add gg
.Body = "Please find attached the weekly report
SendKeys "%{ENTER}", True
End With

How can i use this same method to delete an excel sheet using access without
getting the message about the sheets may not be blank.

All help is appriciated

Regards
Trevor
 
J

JP

If you're automating Excel, then it's

Application.DisplayAlerts = False
' ... your code to delete sheet goes here...
Application.DisplayAlerts = True

where 'Application' represents an instance of the Excel.Application
Object. i.e.

Dim xlApp As Object
' ... instantiate Excel ...

xlApp.DisplayAlerts = False
' delete sheet
xlApp.DisplayAlerts = True

--JP
 
T

trevorC via AccessMonster.com

Thanks JP,

I had already tried this and it failed for some unknown reason.
I tried it again Today and it now works fine, for some unknown reason

I am now left with only 2 things I cannot do as yet via Access VBA Automation

1 set print option for a text box (i can make the text box but can't get to
this option)

2 Unable to create a macro for the excel file without using a templete file
for it. (I can make text box and assign a macro to the click event but it
won't work as the macro isn't there)

Still looking and trying...

Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top