Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Excel Workbook when running VBA 1

Status
Not open for further replies.

jpgactmod

Technical User
Feb 12, 2004
41
0
0
US
I am using VBA to export Access data to an Excel Workbook. The VBA code includes the following:

Ans = MsgBox("Existing Data in " & xWkBkName & " will be replaced. Continue?", vbYesNo, "Data Replacement Warning")
If Ans = vbNo Then Exit Sub

When the program runs, the MsgBox is hidden by the Excel Workbook. How can I ensure that the MsgBox remains visible?

Another problem I have is that while the Excel workbook is being populated, the User can interrupt the operation while selecting an Excel cell. Can I lock Excel while the workbook is being populated to prevent User interruption?

Thank you for any help.

Jim
 
Why not playing with the Visible property of the Excel.Application object ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Yes, that solved both of my problems (visibility and preventing a User from interrupting the program).

Thank you.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top