|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Open Excel when user press OK buttonHi: This is the message box which shows that the file is save in the
my document folder with the file name. Can any one please tell me how to i create another message box with OK Cancel button and with the message "Do you want to open that excel file" If user press Ok it open the excel with that file and if user press cancel it will be stay in the current form. MsgBox "Your document is in My Documents with the name 'Accounts- Distribution " & Format$(Date, "yyyymmdd") & "-" & Format$(Time, "hhmmss") & "-" & maxbatchID & ".xls'" Thanks. "Anna" <colleen1***@gmail.com> wrote in message dim sMsg as stringnews:1172585026.018293.133790@a75g2000cwd.googlegroups.com > Hi: This is the message box which shows that the file is save in the > my document folder with the file name. Can any one please tell me how > to i create another message box with OK Cancel button and with the > message "Do you want to open that excel file" If user press Ok it open > the excel with that file and if user press cancel it will be stay in > the current form. > sMsg="Open the document in My Documents with the name " & _ "'Accounts-Distribution " & Format$(Date, "yyyymmdd") & "-" & _ Format$(Time, "hhnnss") & "-" & maxbatchID & ".xls'?" If vbYes=Msgbox(sMsg,vbYesNo,"Confirm selection") Then ' open document Else ' don't End If -- Reply to the group so all can participate VB.Net: "Fool me once..." Anna wrote:
> Hi: This is the message box which shows that the file is save in the See Bob's post.> my document folder with the file name. Can any one please tell me how > to i create another message box with OK Cancel button and with the > message "Do you want to open that excel file" If user press Ok it open > the excel with that file and if user press cancel it will be stay in > the current form. > > MsgBox "Your document is in My Documents with the name 'Accounts- > Distribution " & Format$(Date, "yyyymmdd") & "-" & > > Format$(Time, "hhmmss") & "-" & maxbatchID & ".xls'" > > Thanks. > To open the Excel-file, you can google for the ShellExecute API function. Using this function makes sure you open the xls-file with the application the user has selected to deal with it (can be OpenOffice too...). Sinna |
|||||||||||||||||||||||