Enyahs Posted December 28, 2009 Share Posted December 28, 2009 Hello, I am trying to create a graph on the same sheet as the data. Here is the code. #include <Excel.au3> #include <Misc.au3> Local Const $xlRows = 1 Local $xLabel = "TIME" Local $yLabel = "BW-OUT" Local $oExcel1 = "\Sample.xls" $oExcel = _ExcelBookOpen($oExcel1,1,1) $oExcel.Range("C3").Select $oExcel.Selection.CurrentRegion.Select $oRange = $oExcel.Selection.Address $sSheetName = $oExcel.ActiveSheet.Name $oExcel.ActiveSheet.ChartObjects.Add(1350, 30, 500, 500).Select $oExcel.Application.CutCopyMode = False $oExcel.ActiveChart.ChartWizard($oExcel.Sheets($sSheetName).Range($oRange), $xlLine, 4, $xlRows, 1, 2, 1, $sSheetName, $xLabel, $yLabel) It was running successfully last week, but now I am getting the error: Variable must be of type "Object" on this code $oExcel.Selection.CurrentRegion.Select $oExcel^ ERROR Hope you could help me. Thank you. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 28, 2009 Share Posted December 28, 2009 Add some error checking for _ExcelBookOpen(). Test with IsObj($oExcel) before continuing. Maybe the path is not valid to the file, or the file no longer opens as a valid workbook. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Enyahs Posted December 29, 2009 Author Share Posted December 29, 2009 Add some error checking for _ExcelBookOpen(). Test with IsObj($oExcel) before continuing. Maybe the path is not valid to the file, or the file no longer opens as a valid workbook. Thank you for your response Psalty DS! I tried adding an error checking, now I am getting this error.\AutoIt3\Include\IE.au3 (238) : ==> The requested action with this object has failed.:$o_object.visible = $f_visible$o_object.visible = $f_visible^ ERRORI checked IE.au3 but I have not used the function _IECreate. Thank you. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 29, 2009 Share Posted December 29, 2009 That doesn't make any sense. Post your modified script with the error checking added. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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