Hi am vijay,
Hi when i using following code
Integer_variable=CInt(Str)
It Shows
"Inadmissible Value or DataType : Overflow" I don know why this is happening... If possible let me clear....
Thanks...
Vijay...
[Solved] Type Conversion Error
[Solved] Type Conversion Error
Last edited by Hagar Delest on Thu Jan 20, 2011 9:03 am, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
openoffice 3.2 and Linux Fedora 13
Re: Type Conversion Error
Hi,
Which string (wich range of numbers) you want to convert?
Please upload an example file here...
Which string (wich range of numbers) you want to convert?
Please upload an example file here...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Type Conversion Error
"Str" is a Basic function which converts a number to a string. Try
s = "1"
n = CInt(s)
or
n = CInt(Str(10))
s = "1"
n = CInt(s)
or
n = CInt(Str(10))
Re: Type Conversion Error
Apart from the CInt() you are not really indicating the programming language that you use.
Assuming it is Basic I reference the Online Help in the section "Macros and Programming"
Use a Long variable and CLong() instead. (just the next paragraph in the online help)
But hey, normally this problem should not lead you to this forum, but instead to start debugging. All the questions with which Zizi64 came up are essential to solve the problem and can be easily answered if you use the debugger of the Basic IDE and step through your code. In the bottom third of the IDE window you can specify variables to watch for. Type [str ] in the text field, hit return and continue stepping through the code. In the section below the variable str will be shown with its current value after each processing step of the macro.
Please read the online help (F1) on the Basic IDE. All the above about debugging is not my wonderful knowledge, but you can find it in the Help of OpenOffice.
Assuming it is Basic I reference the Online Help in the section "Macros and Programming"
Online Help: Using Variables wrote:Integer Variables
Integer variables range from -32768 to 32767. If you assign a floating-point value to an integer variable, the decimal places are rounded to the next integer. Integer variables are rapidly calculated in procedures and are suitable for counter variables in loops. An integer variable only requires two bytes of memory. "%" is the type-declaration character.
Code: Select all
Dim nValue As Integer, theString As String
theString = "100000"
nValue = CInt(theString) ' throws the Overflow runtime error
But hey, normally this problem should not lead you to this forum, but instead to start debugging. All the questions with which Zizi64 came up are essential to solve the problem and can be easily answered if you use the debugger of the Basic IDE and step through your code. In the bottom third of the IDE window you can specify variables to watch for. Type [str ] in the text field, hit return and continue stepping through the code. In the section below the variable str will be shown with its current value after each processing step of the macro.
Please read the online help (F1) on the Basic IDE. All the above about debugging is not my wonderful knowledge, but you can find it in the Help of OpenOffice.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
Re: Type Conversion Error
Hi To all ,
I got cleared with your suggestions... I thank everyone who replied for my post....
Thanks...
vijay
I got cleared with your suggestions... I thank everyone who replied for my post....
Thanks...
vijay
openoffice 3.2 and Linux Fedora 13
Re: [Solved] Type Conversion Error
Hello,
Same issue here in libreoffie macro
using this code and when I run macro getting following error
[*]Inadmissible value or data type.Overflow.
Total rows in the file is 47600 and some more so is it any issue regarding numbers of rows ?
Strange thing is that I am using above code in another macro and In that macro has not any issue but in this macro I have data till nearby 31000 rows
Same issue here in libreoffie macro
using this code
Code: Select all
Sheet = oDoc.Sheets.getByName("File_source")
Curs = Sheet.createCursor
Curs.gotoEndOfUsedArea(True)
NumRows = Curs.Rows.Count
[*]Inadmissible value or data type.Overflow.
Total rows in the file is 47600 and some more so is it any issue regarding numbers of rows ?
Strange thing is that I am using above code in another macro and In that macro has not any issue but in this macro I have data till nearby 31000 rows
Libre Office 5.0/ Open Office /MS Excel/ Windows 7-8
Re: [Solved] Type Conversion Error
Get some book on Visual Basic. The chapter about data types should be right at the beginning.
In Andrew Pitonyak's book "OpenOffice Macros Explained" it is chapter 3.
http://www.pitonyak.org/oo.php
In Andrew Pitonyak's book "OpenOffice Macros Explained" it is chapter 3.
http://www.pitonyak.org/oo.php
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice