Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel Row selection
#1
Hello,

I'm looking for hel with something... what i want is a function that selects a row in excel (or gets the data from the row selected) gets the data so it can be used in the macro. When i click on a button, the next row needs to be selected and the data has to be copied... and so on.

Can somebody help me with this? i dont have a clue where to start !

any help is welcome !

Thanks in advance...

Freggel
#2
Apparently this doesn't work in the QM Beta 2.3.0.1 yet. I'm sure Gint. will shed some insight. Maybe it is just the computer I'm on, or something else I did, but I get:
Error (RT) in "Exell /443"oExell: 0x80010105, The server threw an exception.

Heres the code that worked in QM Version 2.2.1
Function Exell
Code:
Copy      Help
;;All of this will run hidden...
;;so you won't see a thing happen
;;except for outputting variables in QM.

;;Declares the filepath for Excel file to use
str sfile="$desktop$\Test.xls"

;;Declares the name of the sheet to use
;;Make sure the name of the sheet is correct!!
str sheet="Sheet 1"

;;Works the Magic...doesn't seem to work in QM Beta 2.3.0.1...or I have the something wrong?!?
Excel.Application app._create
Excel.Workbook book=app.Workbooks.Open(_s.expandpath(sfile))
ExcelSheet es.ws=book.Worksheets.Item(sheet)

;;Declare the variable you want for data in QM
str Variable

;;Gets data from Sheet in cell row 1 column 1 and puts it to "Variable"
es.GetCell(Variable 1 1)

;;Puts "New Data" into cell row 1 column 1
es.SetCell("New Data" 1 1)
out Variable

;;Saves the Excel sheet
book.Save

;;Closes the Excel
book.Close
#3
the code works well here.
QM 2.3.0, Office 2003, Vista.
#4
Macro
Code:
Copy      Help
;/exe 1
out
ARRAY(str) a
ExcelSheet es.Init
es.GetCells(a) ;;gets all cells. To get only selected cells, use this: es.GetCells(a "sel")
int r c
for r 0 a.len
,if(mes("Row %i" "" "OC" r+1) != 'O') break
,for c 0 a.len(1)
,,str& s=a[c r]
,,out s
#5
It's probably just my computer...I haven't ran an excel code in QM 2.3 until today. Good to know it still works. I'll keep you updated if I have any troubles when I get to my other computer.

Thanks.
Jimmy Vig

**Update...totally works on my other two computers. Must just be something with my computer at the radio station.


Forum Jump:


Users browsing this thread: 1 Guest(s)