1. Translate VBA to Euphoria
- Posted by DonCole May 20, 2016
- 1473 views
Sub Test()
MsgBox Worksheets("Sheet1").Range("A1").Value
End Sub
Can anyone translate this VBA (Microsoft Visual Basic) code to Euphoria code?
It's supposed to read one cell of a Excel Workbook.
Don Cole
2. Re: Translate VBA to Euphoria
- Posted by ChrisB (moderator) May 20, 2016
- 1488 views
Hi Don
Should the title of this post not be 'How do you read a specific cell of an Excel spreadsheet using Euphoria' ?
A quick archive search produced some ideas, or the easier way would be to create a csv from the worksheet, and read it with one of the csv libraries
Of course, if this isn't what you wanted then, that just looks like a value in an array, so no translation really required.
Cheers
Chris
3. Re: Translate VBA to Euphoria
- Posted by jmduro May 20, 2016
- 1490 views
Load this: http://www.rapideuphoria.com/excel_10.zip
There is a demo showing what to do (ExcelObjects.exw). In short:
include eucom/eucom.ew include Excel10.ew include ExcelFuncs.ew include win32lib.ew object App, wbs, wb, wss, ws App = startExcel() wbs = getWorkbooksCollection(App) wb = createWorkbook(wbs) wss = getWorksheetsCollection(wb) ws = selectWorkSheet(wss, 1) object val = getCell(ws, "B1") -- adapt next line to value type VOID = message_box(sprintf("%.2f", {val}), "Info", 0) closeExcel(App) release_com()
Jean-Marc
4. Re: Translate VBA to Euphoria
- Posted by DonCole May 20, 2016
- 1445 views
Load this: http://www.rapideuphoria.com/excel_10.zip
There is a demo showing what to do (ExcelObjects.exw). In short:
include eucom/eucom.ew include Excel10.ew include ExcelFuncs.ew include win32lib.ew object App, wbs, wb, wss, ws App = startExcel() wbs = getWorkbooksCollection(App) wb = createWorkbook(wbs) wss = getWorksheetsCollection(wb) ws = selectWorkSheet(wss, 1) object val = getCell(ws, "B1") -- adapt next line to value type VOID = message_box(sprintf("%.2f", {val}), "Info", 0) closeExcel(App) release_com()
Jean-Marc
Thank you, jmduro;Jean-Mark
I think this what I want. It will take me awhile to test it.
Don Cole