Display Excel/Access windows

R

raviyah

I am running VBA in Access which opens and modifies an Excel workbook. How
can I control which application (Access or Excel) is visible to the user? I
want to sometimes show the Excel and sometimes the Access.
 
C

Clifford Bass via AccessMonster.com

Hi,

Set the Application object's Visible property. Make sure you use error
handling so that you do not leave the Access application invisible.

Public Sub AccessingExcel()

On Error GoTo Handle_Error

Dim appExcel As New Excel.Application

' Make Excel visible
appExcel.Visible = True

' Make current Access invisible
Application.Visible = False

Exit_Sub:
Application.Visible = True
Exit Sub

Handle_Error:
MsgBox "Error #" & err.Number & ": " & err.Description
Resume Exit_Sub

End Sub

Clifford Bass
 

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