vbTab Syntax Error--- Please help

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
pauljr1337
Posts: 2
Joined: Fri May 17, 2019 9:16 pm

vbTab Syntax Error--- Please help

Post by pauljr1337 »

Hello, It's been a long time since I have used open office. I used an excel spreadseet with vba macros for my cash register program. As a small business that has just opened I'd rather not buy a copy of office. I keep getting a syntax error for VB tab. Hoping someone can help me fix the code. I gave up programming decades ago so i understand the basics but coding alludes me nowadays. The vbTab in line 5 is where i am getting the error code. Let me know if you need any other info. Thanks in advance

Code: Select all

Option Explicit 'make sure all variables have to be defined
Public Const code39barcodefontname As String = "Free 3 of 9" 
'Code39 barcode font name, if you use a different Code 39 barcode font 
'change the font name here
Public Const sdDelimiterASCII As String = "," 'The ASCII sales data file delimiter
Public Const sdDelimiterUnicode As String = vbTab 
'The Unicode sales data file delimiter - NOTE: We make this TAB as excel can open 
'a TAB delimited unicode file correctly just by double clicking on the file icon. 
'Excel does not open unicode delimted files correctly if you use a comma as delimiter.
Public Const maxrows As Long = 1048576 
'the maximum number of rows possible in an excel 2007-2010 worksheet
Public trainingmode As Boolean 
'not in EPOS training mode = false; in EPOS training = true
Public Const maxtry As Double = 40 
'the number of times we try to open a file for writing to
Public Const maxsdcols As Double = 41 
'the maximum number sales data columns - See the sales data settings worksheet
Public oldsheet As Worksheet
Last edited by robleyd on Sat May 18, 2019 1:57 am, edited 2 times in total.
Reason: Added Code tags
Open Office 4.1.6
Win 10
pauljr1337
Posts: 2
Joined: Fri May 17, 2019 9:16 pm

Re: vbTab Syntax Error--- Please help

Post by pauljr1337 »

Decided to just buy office 2019. Thanks a ton for this awesome community
Open Office 4.1.6
Win 10
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: vbTab Syntax Error--- Please help

Post by Zizi64 »

Maybe the constant/variable named vbTab is a part of the MS Office environment, but it is unknown in AOO/LO environment.
What is it? Is it an ASCII or UbiCode character? Try to use use an equivalent string value instead it.
Last edited by Zizi64 on Sat May 18, 2019 6:53 am, edited 1 time in total.
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.
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: vbTab Syntax Error--- Please help

Post by JeJe »

vbTab is a constant (a name) used to refer to the tab character, Chr(9)

OO will recognise this constant if you put option compatible at the top of your module but the declaration still produces an error.

You just needed to change it to Public Const sdDelimiterUnicode As String = " " (Its the tab character between the quotes)

Code: Select all

option compatible
Public Const sdDelimiterUnicode As String = "	"
'Public Const sdDelimiterUnicode As String = vbTab 'gives syntax error
Sub Main
msgbox asc(vbTab)
msgbox asc(sdDelimiterUnicode)
End Sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply