I'm pretty new to VB script and teaching myself oo4o.
I found an example on how to call a Oracle Database Package/Procedure from within Excel (Macro).
This example, however, uses a hard-coded value of 10 as input parameter.
Could someone please tell me what the syntax would be if I need to replace that 10 with a value entered into a cell? Cell A1 for example?
So instead of using the 10, a value entered by the user is used instead.
This is the current example code:
Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")
Set empDb = OO4OSession.OpenDatabase("XE", "scott/tiger", 0)
empDb.Parameters.Add "DEPTNO", 10, ORAPARM_INPUT
empDb.Parameters("DEPTNO").serverType = ORATYPE_NUMBER
empDb.Parameters.Add "DNAME", 0, ORAPARM_OUTPUT
empDb.Parameters("DNAME").serverType = ORATYPE_VARCHAR2
empDb.Parameters.Add "DLOC", 0, ORAPARM_OUTPUT
empDb.Parameters("DLOC").serverType = ORATYPE_VARCHAR2
Set PlSqlStmt = empDb.CreateSql("Begin Department.GetDeptname" & _
"(:DEPTNO, :DNAME, :DLOC); end;", 0&)
'Display Department name and location
MsgBox empDb.Parameters("DNAME").Value & empDb.Parameters("DLOC").Value
I'm not quite clear as to which part you need help with.
If your question is how to pass a bind variable via oo4o, the example in the docs should help, but it looks like you already know that part:
It looks like your question though is how to get the value from an Excel form cell, so you might be better off posting that in a Microsoft forum as it's a generic VBA/Excel question unrelated to Oracle.