Sign in to follow this  
Followers 0
joeloyzaga

just starting out and have a few question

4 posts in this topic

I'm new and would like to know if its possible to do this

1. I want to build a gui to build a profile of values used as input to an automation run.

a. most times this already exists and I want to display the values from an excel spreadsheet.

b. I need to give them the option to retain all values, modify what needs to be, preview and submit

c. I need to create new ones

d. I then need to rewrite the spreadsheet. This workbook contains worksheets for each user and its these worksheets that contain the data so I need to read the list of worksheets and display all available users(or create them if not there) and then do above accordingly.

e. Would be nice if the same gui can be redisplayed populated after selection of user

So,

Is this possible? How simple would it be to do? Is there an example of read from excel and display? Would it be easier to read from a list of users rather than list out the worksheet names? Any enlightenment would be appreciated

Share this post


Link to post
Share on other sites



Joel,

Welcome.

You are on the right track, you have listed the objectives of your project.

The next step is to look at the help file for code examples related to each step, expand this to searching the forums.

Put together some code for each step and post it here if you have issues.

Finally bring together all the pieces into a single script.

Good luck.

I'm new and would like to know if its possible to do this

1. I want to build a gui to build a profile of values used as input to an automation run.

a. most times this already exists and I want to display the values from an excel spreadsheet.

b. I need to give them the option to retain all values, modify what needs to be, preview and submit

c. I need to create new ones

d. I then need to rewrite the spreadsheet. This workbook contains worksheets for each user and its these worksheets that contain the data so I need to read the list of worksheets and display all available users(or create them if not there) and then do above accordingly.

e. Would be nice if the same gui can be redisplayed populated after selection of user

So,

Is this possible? How simple would it be to do? Is there an example of read from excel and display? Would it be easier to read from a list of users rather than list out the worksheet names? Any enlightenment would be appreciated

Share this post


Link to post
Share on other sites

keeps on generating excel spreadsheets - I thought it would only do it on each selected list - perhaps I'm missing something subtle?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$ListRuntype = GUICtrlCreateList("", 40, 48, 121, 97)
GUICtrlSetData(-1, "Solution|Sanity|Regression")
$ListEnvironments = GUICtrlCreateList("", 40, 98, 121, 97)
GUICtrlSetData(-1, "Regression|Shakedown")
$Button1 = GUICtrlCreateButton("Button1", 144, 200, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $nMsg = $ListRuntype
        ;MsgBox(1, "Test", GUICtrlRead($ListRuntype), 10)
            $oExcel = ObjCreate("Excel.Application")
            $oExcel.Visible = True
            $oExcel.Workbooks.add
            $oExcel.ActiveWorkbook.Sheets(1).Cells(1, 1).Value = "Run Type"
            $oExcel.ActiveWorkbook.Sheets(1).Cells(2, 1).Value = GUICtrlRead($ListRuntype)
        Case $nMsg = $ListEnvironments
            MsgBox(1, "Test", GUICtrlRead($ListEnvironments), 10)
            $oExcel = ObjCreate("Excel.Application")
            $oExcel.Visible = True
            $oExcel.Workbooks.add
            $oExcel.ActiveWorkbook.Sheets(1).Cells(1, 1).Value = "Environment"
            $oExcel.ActiveWorkbook.Sheets(1).Cells(2, 1).Value = GUICtrlRead($ListEnvironments) 
        Case $Button1
            Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

Shouldn't the excel automation trigger only when the button is pressed? If so you need to put those lines under "Case $Button1".

Share this post


Link to post
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
Sign in to follow this  
Followers 0