Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handle to existing Excel document
#14
Thanks for trying Gintaras.

To work around this, I created a function that works around this issue:
Code:
Copy      Help
/
function str'name ExcelSheet&es1

int w1 w2
str s
double t

;;wait for up to 30 sec to activate
w1=wait(30 WC name)
act(w1)

;;del the temp file
s.expandpath("$temp$\temp33333.xlsx")
del- s
err

;;save as to temp file
Acc a2=acc("Save As" "SPLITBUTTON" w1 "NetUIHWND" "" 0x1001)
a2.Mouse(1)
wait(5 WC win("Save As"))
s.setwintext(id(54 win("Save As" "bosa_sdm_XL9")))
Acc a3=acc("Save" "PUSHBUTTON" win("Save As" "bosa_sdm_XL9") "bosa_sdm_XL9" "" 0x1001)
a3.DoDefaultAction

;;close
act(w1)
key Af c

;;open ExcelSheet
out s
es1.Init("Sheet1" 4 s)

You can call it with this code:
Code:
Copy      Help
ExcelSheet es1
str s
GetOpenExcel("Book1" es1)

It may only work with Excel 2007. I'm sure it could be optimized.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)