Jump to content

About using autodiagram in Excel 2003 [Help!]


 Share

Recommended Posts

Hi,

I am trying to use AutoIT3 (v. 3.3.0.0) to draw some flow charts in Excel 2003. However, I realize there is no udf which calls the .addshape() method, so I have to do it on my own...but failed..

could anybody help me out here and see what's wrong in my code?

One thing which confuses me is, i could call the addline() method under the object Shapes but not the addshape(). I have searched MSDN but cant find a clue. Your help would be appreciated! Thanks for reading my post~

;#include<excel.au3>
$oExcel = ObjCreate("Excel.Application")
    With $oExcel
        .Visible = 1
        .WorkBooks.Add
        .ActiveWorkbook.Sheets(1).Select ()
        .cells.columnwidth=1.71
        .activesheet.name="testing"
    EndWith
;$oExcel.Activesheet.Cells(1, 1).Value = 'testing!'
    $oExcel.ActiveSheet.Cells(1, 1).Select
    $oExcel.ActiveSheet.Shapes.AddLine(0, 0, 165, 165).Select
    $oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5)
Edited by FelixKan
Link to comment
Share on other sites

Try this and tell me if it works because I don't have the library type atm to test it... no excel either lol.

$oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5).Select

Thanks for your reply~ i have tried your suggestion:

$oExcel = ObjCreate("Excel.Application")
    With $oExcel
        .Visible = 1
        .WorkBooks.Add
        .ActiveWorkbook.Sheets(1).Select ()
        .cells.columnwidth=1.71
        .activesheet.name="testing"
    EndWith
;$oExcel.Activesheet.Cells(1, 1).Value = 'testing!'
    $oExcel.ActiveSheet.Cells(1, 1).Select
    $oExcel.ActiveSheet.Shapes.AddLine(0, 0, 165, 165).Select
    $oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5).Select

but still failed. My error message is:

drawFlowChart.au3 (13) : ==> The requested action with this object has failed.:

$oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5).Select

$oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5)^ ERROR

any idea...??

Link to comment
Share on other sites

Try this and tell me if it works because I don't have the library type atm to test it... no excel either lol.

$oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5).Select

Thanks for your reply~ i have tried your suggestion:

$oExcel = ObjCreate("Excel.Application")
    With $oExcel
        .Visible = 1
        .WorkBooks.Add
        .ActiveWorkbook.Sheets(1).Select ()
        .cells.columnwidth=1.71
        .activesheet.name="testing"
    EndWith
;$oExcel.Activesheet.Cells(1, 1).Value = 'testing!'
    $oExcel.ActiveSheet.Cells(1, 1).Select
    $oExcel.ActiveSheet.Shapes.AddLine(0, 0, 165, 165).Select
    $oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5).Select

but still failed. My error message is:

drawFlowChart.au3 (13) : ==> The requested action with this object has failed.:

$oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5).Select

$oExcel.ActiveSheet.Shapes.AddShape("msoShapeFlowchartPredefinedProcess", 0, 165,76.5, 25.5)^ ERROR

any idea...??

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...