Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to popup msgbox in this vumian[_17_] Excel Programming 8 July 31st 06 05:44 PM
Popup MsgBox jackle Excel Discussion (Misc queries) 1 February 13th 06 03:44 AM
Novice - MsgBox Yes/No - Continue if Yes, Close if No Beetlejuice Excel Discussion (Misc queries) 6 August 29th 05 09:48 PM
Making a Msgbox popup Todd Huttenstine[_2_] Excel Programming 5 December 28th 03 10:49 PM
MsgBox Popup in Excel Danny Legault Excel Programming 1 November 6th 03 02:13 PM


All times are GMT +1. The time now is 06:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"