smahdi83 Posted October 24, 2007 Posted October 24, 2007 Hello, I am trying to copy data from excel and then paste that data into an Autoit listview. For example, please refer to uploaded images. As an alternative, I tried using ObjCreate("OWC10.spreadsheet") -- check Autoit code -- to create a grid inside my program directly. The problem with that is that if I use this grid within a tab object( which is what I need to do), it starts behaving weird (i.e. the grid disappears when we type data into the cells, the object randomly changes location). So if anyone has a solution to the Excel grid problem, that would be awesome. Thanks in advance, expandcollapse popup#include <GUIConstants.au3> Local $oExcel1 ;Declare objects $oExcel1 = ObjCreate("OWC10.spreadsheet"); Default to Office XP If not IsObj($oExcel1) Then $oExcel1 = ObjCreate("OWC11.spreadsheet"); Office 2003 EndIf If not IsObj($oExcel1) Then $oExcel1 = ObjCreate("OWC00.spreadsheet"); Office 2000 EndIf If IsObj($oExcel1) Then With $oExcel1 .Worksheets("Sheet1").Protect .Worksheets("Sheet1").Cells.Range("A:B").Locked = False EndWith Else MsgBox(0,"Reply","Not an Object",4) EndIf $mainform_form = GUICreate("Claret Trading Platform v.1.00 - ", 1107, 661, 116, 151, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_TABSTOP, $WS_BORDER, $WS_CLIPSIBLINGS)) $main_tab = GUICtrlCreateTab(168, 8, 937, 649) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $allocation_bulk_sheet = GUICtrlCreateTabItem("Allocation:Bulk") $allocation_bulk_reguacc_excel = GUICtrlCreateObj($oExcel1, 305, 200, 220, 420) GUICtrlSetStyle($allocation_bulk_reguacc_excel, $WS_VISIBLE) GUICtrlSetResizing ($allocation_bulk_reguacc_excel, $GUI_DOCKAUTO) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit
Xand3r Posted October 24, 2007 Posted October 24, 2007 Try Clipput Clipget GuiCtrlCreateListViewItem Cheers Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
smahdi83 Posted October 24, 2007 Author Posted October 24, 2007 Try Clipput Clipget GuiCtrlCreateListViewItem Cheers Ok thanks for that but does anyone know how I can stop the Excel COM object from dissapearing every time i enter data into a cell? That would make my life much easier than trying to copy/paste data into the Listview. Thanks,
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