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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: jmi44
  • Order by date
  1. jmi44

    default value

    Thank you Golom and SBerthold. The solution with On Error Resume Next is much better than my "spaghetti code". But it is still four lines of code instead of just one with the desired (but probably impossible) solution.
  2. jmi44

    default value

    I have many calls to different functions that may sometimes provoke errors. In a case of an error, I want them to return a default value. This is possible in the following "spaghetti code" example: Sub MainTest() a = 1 b = 0 On Error GoTo DivisionErrorHandler c = a / b On...
  3. jmi44

    BeforeSave: how to distinguish "Save" from "SaveAs" in Excel

    While in Workbook_BeforeSave, is there a way to tell whether the user saves the workbook (via menu File->Save or via the Save button) or whether she uses the menu File->Save As? I need to execute some actions before the workbook is saved, and these actions depend on the save mode used.
  4. jmi44

    a message box question

    George, Thank you again for your code. I have played with it and learned a lot. Unfortunately, it would be too difficult to use events in my context, where the application exists already: introducing events would need to reorganize the existing code into class modules and changing methods calls...
  5. jmi44

    a message box question

    dilettante, This is me that missed something, not you! I missed mentionning that my startup form (which is modal) is a user form in a VBA Excel application. And in Excel (but not in pure VB), you cannot call a modeless form from a modal form (By the way, I do not see why this should be...
  6. jmi44

    a message box question

    George, Thank you very much for this working example of Events. I am not familiar with them so I appreciate a lot this example which is placed in the context of my present problem. I am affraid, however, that this does not solve my problem (at least directly). Your solution still needs a form...
  7. jmi44

    a message box question

    I think that at this point I need to explain better the context. I have a method (called "service" hereafter) that makes a lot of calculations, organized in several steps. This service can be called by a user interface (a modal user form) or by a batch. I want that 1) the user be informed which...
  8. jmi44

    a message box question

    The counter on Form1 continues because the timer process started before you click on the cmd button. Here you are right: Form2.Show vbModal does not stop other processes. But it does stop the process that called Form2.Show vbModal. Try this modification of your example (without the timer)...
  9. jmi44

    a message box question

    Yes, you are right: ShowModal=True comes from Excel VBA UserForms. It has the same effect as calling a form with FormX.Show vbModal. FormX.Show vbModal DOES stop execution of the program until the FormX is closed. (Otherwise, you are right, other processes are not stopped. I am still able to...
  10. jmi44

    a message box question

    Well, the problem with the solution proposed by mmbsports is that if the message box form is shown as modal (ShowModal=True) then the program stops the execution until the message box is closed (not really what is needed!). On the other hand, if the message box form is made non modal...

Part and Inventory Search

Back
Top