1. Translate VBA to Euphoria

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

new topic     » topic index » view message » categorize

2. Re: Translate VBA to Euphoria

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Translate VBA to Euphoria

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: Translate VBA to Euphoria

jmduro said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu