Skeletor Posted October 11, 2018 Share Posted October 11, 2018 @Shaik, try this: Local $sWorkbook = "C:\Users\MasthanS.BSG\Downloads\123.xlsx" ; Combine this.. no need to split. ;Make local not Global... only referring once. _Excel_BookSaveAs($oWorkbook, $sWorkbook, $xlOpenXMLWorkbook, True) If @error Then Exit MsgBox ($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example 1", "Error saving workbook to '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example 1", "Workbook successfully saved as '" & $sWorkbook & "'.") ShellExecute($sWorkbook) ; Close the workbook without saving _Excel_BookClose($oWorkbook, False) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookClose Example 1", "Error saving workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookClose Example 1", "Workbook has been successfully closed.") Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI Link to comment Share on other sites More sharing options...
Shaik Posted October 11, 2018 Share Posted October 11, 2018 I need to concatenate there because i am passing the path through selenium Link to comment Share on other sites More sharing options...
Shaik Posted October 11, 2018 Share Posted October 11, 2018 that's what i am also thinking, please give me the solution how i can close the excel workbook which is opened by Workbookopen func only Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now