Form graphics blank when running command

I have a macro that shows a form while performing a BOM export.  The form popsup but the actual windows doesnt display (its white) until the BOM export is done.  It seems like a graphics issue.  As a test, I added a message box before running the BOM export and the form displays correctly.

Seems like the screen isnt refreshing or showing the form, is there command to prevent this from happening?

SolidworksApi macros