| View previous topic :: View next topic |
| Author |
Message |
jaango123 General User

Joined: 12 Apr 2012 Posts: 12
|
Posted: Fri May 11, 2012 3:38 am Post subject: [Solved]Openoffice basic equivalent for this line |
|
|
Hi ,
In VBA I have
| Code: |
AsciiString = AsciiString & Chr(WorksheetFunction.Hex2Dec(DataArray(Ndx)))
|
What would be the Openoffice basic equivalent
I tried this, but getting an error - object variable not set
| Code: |
Dim oSheet2, FuncService
osheet2=thiscomponent.sheets(0)
FuncService = createunoservice("com.sun.star.sheet.FunctionAccess")
AsciiString = AsciiString & Chr(FuncService.callFunction("HEX2DEC",DataArray(Ndx))) |
Last edited by jaango123 on Fri May 11, 2012 9:12 am; edited 1 time in total |
|
| Back to top |
|
 |
jaango123 General User

Joined: 12 Apr 2012 Posts: 12
|
Posted: Fri May 11, 2012 5:02 am Post subject: Re: Openoffice basic equivalent for this line |
|
|
The below line also giving object variable not set at the print
| Code: |
i=50
print FuncService.callFunction( "HEX2DEC", i)
|
|
|
| Back to top |
|
 |
patel Power User

Joined: 14 Apr 2012 Posts: 54 Location: Italy
|
Posted: Fri May 11, 2012 5:32 am Post subject: |
|
|
You have to add "&H" befor the hex string an use cdec function, see this
| Code: | Sub Hex2dec-conversion()
a = "&HBB"
b=cdec(A)
MsgBox (b)
End Sub |
_________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button). |
|
| Back to top |
|
 |
jaango123 General User

Joined: 12 Apr 2012 Posts: 12
|
Posted: Fri May 11, 2012 7:58 am Post subject: |
|
|
| Thanks. Please mark it as solved. I dont see that option. |
|
| Back to top |
|
 |
patel Power User

Joined: 14 Apr 2012 Posts: 54 Location: Italy
|
Posted: Fri May 11, 2012 8:35 am Post subject: |
|
|
I can't, only you can do it _________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button). |
|
| Back to top |
|
 |
|