Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.Net - Excel Spreadsheet and MessageBox

Posted on 2013-06-07
3
Medium Priority
?
423 Views
Last Modified: 2013-07-10
Good Day Experts!

I have a little application here that ouputs an Excel spreadsheet.  I have added functionality to email and save automatically.  However, I need to be able to review the figures in the spreadsheet before emailing.  So, I put a messageBox in to temprarily stop processing to remind the User to review the figures.  

Only issue I have is when the messageBox pops-up it is behind the spreadsheet.  How can I make it be in front?

Here is my code for the MessageBox:

Dim Result As DialogResult = MessageBox.Show("Review the figures on the spreadsheet. Click Yes to save/auto-email or No to re-run.", "Check Values", MessageBoxButtons.YesNo)

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
jay813 earned 1000 total points
ID: 39230776
You could create a form that looks like a message box, change its .topmost property to true. That way you could also customize your buttons to say "Email" rather than having a yes/no dialog. Just some food for thought..
0
 
LVL 10

Assisted Solution

by:adriankohws
adriankohws earned 1000 total points
ID: 39231061
Yes, like what jay813 said, you can do that. Otherwise you have to write your own class message box so that you have topmost property to use.

There's also one way to try, make sure your application is on focus before calling the messagebox. Messagebox is not the topmost only when your application has actually lost focus. (Maybe the Excel application is focus during that time).

Actually if you were to ask me, I found the flow a bit weird. You should try to consider other flow, for example, inform the user before Excel even started, just a recommendation...
0
 

Author Comment

by:Jimbo99999
ID: 39239307
Thanks for the feedback, I will try it.  

Previous flow was to generate the report.  I had to look at the figures on the report and if all the checks matched then we were good.  If they did not match I had to figure out in db why then repair and re-run report. Once report is good then it is emailed in Outlook.

Now we want to auto email it through the program in event we forget to manually do it in Outlook.  So I was using the messageBox to temporarily stop code execution to review the figures.  If figures match I hit continue on the messageBox and the program sends email.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question