sammy1983 Posted March 5, 2014 Share Posted March 5, 2014 Hi, I am getting below error "D:DesktopTest.au3" (62) : ==> Variable used without being declared.: Local $oExcel = _ExcelBookOpen($sFilePath1, 0, 0) Local $oExcel = _ExcelBookOpen(^ ERROR Any suggestions? #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <Toast.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 5, 2014 Moderators Share Posted March 5, 2014 sammy1983, Any suggestions?Yes, post the part of the script where you declare $sFilePath1 - a list of includes does not really help anyone. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sammy1983 Posted March 5, 2014 Author Share Posted March 5, 2014 (edited) sammy1983, Yes, post the part of the script where you declare $sFilePath1 - a list of includes does not really help anyone. M23 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $btn GUISetState(@SW_HIDE) Local Const $sMessage = "Please select the file" Local $sFilePath1 = FileOpenDialog($sMessage, @WindowsDir & "", "Excel file (*.xls;*.xlsx)", $FD_FILEMUSTEXIST) If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "Info", "No file(s) were selected. Task abandoned.") Exit EndIf ExitLoop EndSelect WEnd Local $oExcel = _ExcelBookOpen($sFilePath1, 0, 0) ; Opens an existing excel File Output: --------- "D:DesktopTest.au3" (62) : ==> Variable used without being declared.: Local $oExcel = _ExcelBookOpen($sFilePath1, 0, 0) Local $oExcel = _ExcelBookOpen(^ ERROR Edited March 5, 2014 by sammy1983 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 5, 2014 Moderators Share Posted March 5, 2014 sammy1983,And how do you get to the Local $oExcel = _ExcelBookOpen($sFilePath1, 0, 0) line which is giving you the problem? Posting the whole script might be a good idea or we will be here all night. M23P.S. When you post code please use Code tags - see here how to do it. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sammy1983 Posted March 5, 2014 Author Share Posted March 5, 2014 Found the glitch!!! After Case $msg = $GUI_EVENT_CLOSE, instead of using ExitLoop, tried just Exit and it worked. Thanks Melba. Link to comment Share on other sites More sharing options...
sammy1983 Posted March 5, 2014 Author Share Posted March 5, 2014 sammy1983, And how do you get to the Local $oExcel = _ExcelBookOpen($sFilePath1, 0, 0) line which is giving you the problem? Posting the whole script might be a good idea or we will be here all night. M23 P.S. When you post code please use Code tags - see here how to do it. Sure. Now I got to know how to post the code. Will follow henceforth. You know I am a newbie. :-) 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