Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
popup msgbox ok continue simple code
After my macro runs (and does a "file save as" automatically) I want a popup
message box to display with an OK or Continue button, and a simple message stating that the file was saved or the process is complete. If you have code that can verify that the file was saved that would be great. But if that is not possible then just an example of how to get the box to appear and exit the procedure when the button is pressed will work. This is my save routine if it helps you be more specific in the example code. I just steal bits and pieces from posts so it is probably messy looking to real programmers. 'Procedure to save the Sales Workbook to the Sharepoint Library Sub SaveWork() Dim venname As String Dim vennumber As String Dim venyear As String Dim venperiod As String venname = Worksheets("Sales").Range("B2") vennumber = Worksheets("Sales").Range("B3") venyear = Worksheets("Data").Range("J15") venperiod = Worksheets("Data").Range("J16") ActiveWorkbook.SaveAs Filename:="HTTP://teams.kedc.org/mst/Sales_Reports/" & venname & "_" & vennumber & "_" & venyear & "_" & venperiod & ".xls" End Sub Any help is greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
popup msgbox ok continue simple code
This modification to the ending of your sub should do the trick.
If the message box does not show the name you wanted to save the file under, then you know it did not save. If it shows the correct name then it did do the save. ActiveWorkbook.SaveAs Filename:="HTTP://teams.kedc _ .org/mst/Sales_Reports/" & venname & "_" & vennumber & _ "_" & venyear & "_" & venperiod & ".xls" MsgBox "File was saved as " & ActiveWorkbook.Name End Sub "anduare2" wrote: After my macro runs (and does a "file save as" automatically) I want a popup message box to display with an OK or Continue button, and a simple message stating that the file was saved or the process is complete. If you have code that can verify that the file was saved that would be great. But if that is not possible then just an example of how to get the box to appear and exit the procedure when the button is pressed will work. This is my save routine if it helps you be more specific in the example code. I just steal bits and pieces from posts so it is probably messy looking to real programmers. 'Procedure to save the Sales Workbook to the Sharepoint Library Sub SaveWork() Dim venname As String Dim vennumber As String Dim venyear As String Dim venperiod As String venname = Worksheets("Sales").Range("B2") vennumber = Worksheets("Sales").Range("B3") venyear = Worksheets("Data").Range("J15") venperiod = Worksheets("Data").Range("J16") ActiveWorkbook.SaveAs Filename:="HTTP://teams.kedc.org/mst/Sales_Reports/" & venname & "_" & vennumber & "_" & venyear & "_" & venperiod & ".xls" End Sub Any help is greatly appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
popup msgbox ok continue simple code
That works beautifully, thanks so much.
"JLGWhiz" wrote: This modification to the ending of your sub should do the trick. If the message box does not show the name you wanted to save the file under, then you know it did not save. If it shows the correct name then it did do the save. ActiveWorkbook.SaveAs Filename:="HTTP://teams.kedc _ .org/mst/Sales_Reports/" & venname & "_" & vennumber & _ "_" & venyear & "_" & venperiod & ".xls" MsgBox "File was saved as " & ActiveWorkbook.Name End Sub "anduare2" wrote: After my macro runs (and does a "file save as" automatically) I want a popup message box to display with an OK or Continue button, and a simple message stating that the file was saved or the process is complete. If you have code that can verify that the file was saved that would be great. But if that is not possible then just an example of how to get the box to appear and exit the procedure when the button is pressed will work. This is my save routine if it helps you be more specific in the example code. I just steal bits and pieces from posts so it is probably messy looking to real programmers. 'Procedure to save the Sales Workbook to the Sharepoint Library Sub SaveWork() Dim venname As String Dim vennumber As String Dim venyear As String Dim venperiod As String venname = Worksheets("Sales").Range("B2") vennumber = Worksheets("Sales").Range("B3") venyear = Worksheets("Data").Range("J15") venperiod = Worksheets("Data").Range("J16") ActiveWorkbook.SaveAs Filename:="HTTP://teams.kedc.org/mst/Sales_Reports/" & venname & "_" & vennumber & "_" & venyear & "_" & venperiod & ".xls" End Sub Any help is greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to popup msgbox in this | Excel Programming | |||
Popup MsgBox | Excel Discussion (Misc queries) | |||
Novice - MsgBox Yes/No - Continue if Yes, Close if No | Excel Discussion (Misc queries) | |||
Making a Msgbox popup | Excel Programming | |||
MsgBox Popup in Excel | Excel Programming |