PDA

Click to See Complete Forum and Search --> : Sendkeys problem....


Chrissy
Jun 13th, 2006, 08:22 AM
Hello,

I have an Excel "Master" file that I use to open a bunch of workbooks, make changes, then save the workbook. In each of the individual workbooks, there is code that shows a messagebox if the workbook is out of balance. I want to suppress this messagebox. The code I am using is:

Workbooks(xTemplate).Close True
SendKeys "{Enter}"

The above code works fine for suppressing that messagebox, but it seems to be suppressing subsequent message boxes as well. How do I code it so the sendkey only applies to the above message?

Thank you.

RobDog888
Jun 13th, 2006, 08:24 AM
What event is this code in? Which msgs are you missing?

Chrissy
Jun 13th, 2006, 08:30 AM
The code is in a sub that I created. The messagebox stating if the workbook is out of balance shows upon saving the workbook. It won't always show...if the workbook is in balance, the message box won't show. Maybe that is the problem. I have a couple of different messageboxes, one that shows when the update is complete, and one that shows if there were any errors while updating. These never show with the sendkeys code.

RobDog888
Jun 13th, 2006, 08:35 AM
Perhaps it would be better to rethink the logic here.

If the workbook is out of balance then if you had that written to a specific sheet or written out to a log file you could read it with out needing a msgbox in the out of balance workbook. It could all be done in the master workbook. This way it wont hold up any saves or such.

Chrissy
Jun 13th, 2006, 08:46 AM
The individual workbooks get worked on individually by users. The messagebox in the save event is to make the user aware that the spreadsheet is out of balance so they can fix it. The purpose of the master file is only to reset the worksheets with new numbers for the next projection to be done.