Click here to Skip to main content
15,889,595 members
Everything / Programming Languages / Visual Basic 6

Visual Basic 6

VB6

Great Reads

by Chris Boss
Visual Basic 6.0 just doesn’t want to disappear. Why ? Likely many have written vital applications using VB 6.0 and Visual Basic dot.net is so different that it is not a viable option.
by Duncan Edwards Jones
Part 2 in the series showing how to write a debugger in VB
by Len Holgate
This example COM component provides 3 COM objects for using the Win32 Mailslot IPC mechanism. The component may be useful if you need to communicate from VB using Mailslots.
by kirkaiya
A very simple, XAML-based month-view calendar that shows appointments, exposes events, and allows dragging appointments in the current month.

Latest Articles

by ToughDev
How to convert OFT to .NET Windows Form in VS
by Paul Aurelian Gagniuc
This article shows how to mix two signals into a third, in variable proportions.
by FranciskaR
More on fluid simulation
by FranciskaR
A new approach to fluid simulation

All Articles

Sort by Updated

Visual Basic 6 

1 Apr 2024 by Graeme_Grant
Okay, Google is your friend: 1. vb6 json - Google Search[^] - finds: https://stackoverflow.com/questions/2782076/is-there-a-json-parser-for-vb6-vba[^] 2. vb6 rest call - Google Search[^] finds:...
1 Apr 2024 by Jawad Rizvi
Hi : i am first time posting question on this platform but been using it for long time for help. Advance thanks to all the guys. i am using vb6 for a long time, my question is i have an application where i am integrating a loyalty card system...
6 Feb 2024 by Richard MacCutchan
See Access help & learning[^].
21 Jan 2024 by Member 15109325
Sorry for the late reply folks, I think I found an ISO on an old SSD backup, I'll try on my laptop. And thank you
17 Dec 2023 by Richard MacCutchan
You could find it easily: visual basic 6.0 free download - Google Search[^]
16 Dec 2023 by Dave Kreskowiak
For free? You can't. There was never a free version, and the thing has been out of support for quite a long time now.
16 Dec 2023 by Member 15109325
I have an old 2007 project I haven't touched in years and I want to resurrect it and rebuild in VB.NET. But before I start I wanted to review it to see if it's really worth the time-effort and get a glimpse of the various forms, concepts and...
5 Nov 2023 by Vis Kataboman
I seem to have got a VB 6.0 form icon within the form. I can't seem to get rid of it. It does not go away when I run the form and not even when the executable is being launched, see the image[^] Can anyone tell me how I can get rid of this...
4 Nov 2023 by Ub soft
I want to make my object move to the right when it gets to a particular point, then it starts all over again. What I have tried: label4.move if label4.move= command
3 Nov 2023 by Dave Kreskowiak
There is no such thing as a Move method on a label. You have to compute and set the Top and Left properties of the label control t move it to a new location. To give it constant motion, you have to constantly compute and set those properties for...
29 Oct 2023 by CHill60
In the Visual Basic IDE draw a sqare around the area where the icon appears using your mouse. If there is a control in that area it will be selected and you can use the Properties window to determine what it is. You can probably just hit delete...
29 Oct 2023 by M Imran Ansari
It seems that you are encountering an issue with an unwanted VB 6.0 form icon appearing within the form, even when running the application. Unfortunately, without seeing the image (provided link is not working and demanding for access) or having...
11 Oct 2023 by Gabriel Adrian
Hola a todos, tengo un error al usar MAPI y VB6 con Outlook. Error 32002 al ejecutar: Hello everyone, I have an error using MAPI and VB6 with Outlook. Error 32002 when running: MAPIMessages1.Send True alguno podra ayudarme? could anyone help...
2 Oct 2023 by Ronalyn Ablang 2023
I've been using the same code for the past 3 months, but when I opened and tried to run my code, it kept on showing the error but all the necessary data is still showing fine. I've already created the column in design but idk what happen with it....
25 Sep 2023 by OriginalGriff
Read the error message: it couldn't be any clearer: Error: No row can be added to a DataGridView control that does not have columns. Columns must be added first. It's even telling you what you need to do first! Quote: But I already created the...
19 Sep 2023 by Member 11094907
I have a very old VB6 software licensed on an old Win7 pc. The developer can't be reached, and the PC got corrupted. When the software with license was installed to the new PC, it requests a new license. Any idea how to solve this? Any help...
17 Sep 2023 by OriginalGriff
Pretty much you are stuffed. If you can't contact the original developer you can't get a new licence. If you don't have a record of the original licence and you can't get a new one, you can't install the software, regardless of what it does. ...
17 Sep 2023 by Richard MacCutchan
There is no way anyone here could answer such a question. We have no idea what the program does, how it does it, or what licencing method it uses.
7 Sep 2023 by Member 16087465
I dont think a generic solution exists. But one approach which might get you partway there is to try to open the file in your code, using its application, derived from the file type suffix . EG trying to open a .DOC or .DOCX with...
17 Aug 2023 by THEBAULT Jacques
Hello everybody Thanks for your quick answers. To be more precise, I don't try to use a property of MSVidCtl class but to use the class IMSVidDevice, which isn't a member of MSVidCtl itself, but comes in the same time when referencing "MS Video...
16 Aug 2023 by Graeme_Grant
There is an article here on Code Project that is specific to this task. It is in C++ though: Determining the Monitor's On/Off (sleep) Status[^] Otherwise, here is a Google Search with a number of helpful possibilities: how to get the windows...
16 Aug 2023 by Dave Kreskowiak
You have a bit of a problem. There is nothing "Power" related in the MSVidCtl COM interfaces/classes. The MSVidCtl library is for video control, like TV output, tuning, Closed Captioning, DVD playback, ... It has nothing to do with monitors and...
16 Aug 2023 by THEBAULT Jacques
My problem is to get the status power of my desktop display in order to stop some applications when it is OFF (the computer being always ON, night as day) Why under VB6? I explained a lot about that in the topic:...
12 Jul 2023 by Member 16004169
Code working for 20+ years, suddenly produces a blank .bmp file. the code: SavePicture ZigZagPic.Image, APPDirectory + "45-3-Z.bmp" an image is there; i can see it. APPPDirectory is valid. picturebox ZigZagPic.scalemode = vbpixels,...
8 Jul 2023 by OriginalGriff
The first thing to note is that you definitely shouldn't be saving your images in the app directory: in production machines that is under "Program Files" (or "Program Files (x86)") and those folders are write protected under modern OSes to reduce...
7 Jul 2023 by marvinaccent
I'm just new in programming and I want to know how will I put the values listed in my List view to a csv file.Thanks
7 Jul 2023 by Member 16045875
Public Sub ExportListviewToCsv(ByRef theListView As ListView, csvExportFileName As String, Optional writeHeader As Boolean = True, Optional useQuotes As Boolean = True) Dim fileNum As Integer Dim theListItem As ListItem Dim idx As...
2 Jun 2023 by Member 16020707
I have built a movie theater library in VB6. But keep forgetting which was the last movie watched. Want to make a text box that holds that information and automatically changes it when watching the next movie. All data for movie is held in...
2 Jun 2023 by OriginalGriff
VB6? Seriously? A new VB6 project in 2023? You do realize it was superseded over 20 years ago by the .NET version? Anyway ... You need to store the info somewhere, and presumably the DataGrid is backed up by a database of some form (but without...
25 May 2023 by Dave Kreskowiak
You can't! The file doesn't know if it is password protected. It is literally ONLY data. The application that uses that file is the only thing that would possibly know if the file it's using is password "protected", which is really just...
25 May 2023 by Member 15418280
How can we check any file is password protect or not in c# What I have tried: We tried but we need to specify file type but we want to check any file whether excel csv word or any file
24 May 2023 by OriginalGriff
You can't: password protected data is encrypted (or you wouldn't need a password to access it) and without the correct password it just looks like random numbers - which is exactly what a random data file can look like. Yes, you can sometimes say...
14 Apr 2023 by Member 13322574
I AM USING ALWAYS DATAREPORT...LET ME KNOW , HOW TO WRITE PRINT COMMAND ON VB6. MY LEDGER DATAS SHWOING MSFLEXGRID ....HOW I CAN WRITE PRINT PROGRAM...PAPERSIZE A4 What I have tried: I AM USING DATAENVIRONMENT AND DATAREPORT ...
14 Apr 2023 by Richard MacCutchan
https://www.vbtutor.net/lesson39.html[^]
3 Apr 2023 by Richard MacCutchan
VB6 is long dead but ... vb6 context menu - Google Search[^]
3 Apr 2023 by seri 2023
I have a requirement for showing submenu for 'Open With 'context menu item. submenu contains some options for open with. What I have tried: I have tried with showing a list box but that is not the requirement
3 Apr 2023 by Sh.H.
Hi people. I used System.Drawing to import an image to my project. I need to import the image and find all black pixels of 10th row of it. But it gets me error on loading the picture. I mean on line 4. Any help please? P.S: I have ticked both ...
3 Apr 2023 by CHill60
You can't use the Bitmap from System.Drawing in VBA. If you right-click on the work "Bitmap" in sampleImage = New Bitmap(Image.FromFile(sampleFileName)) and choose "Definition" you'll get "Indentifier under cursor is not recognized"....
3 Apr 2023 by OriginalGriff
Without access to your system, we probably can't help that much, but at a guess it's the location of the macro that is causing the problem. If the macro is located in (say) personal.xls rather than in the workbook itself, ThisWorkbook.Path will...
30 Mar 2023 by Everdome io
Hello, i have a small project in vb6, which detects if a process is active then exit sub. After exit sub, i have one more piece of code which must be executed. The problem comes after exit sub. The rest part of the code doesn't execute, since the...
30 Mar 2023 by OriginalGriff
No, exit sub end's the method completely at that point and returns control to the method that called it. To do more inside the method, you should set a flag or change the way you test: Current: if (process exists) exit do something else...
19 Mar 2023 by Richard MacCutchan
I am afraid you are asking at the wrong place. If you want to employ a programmer then you should go to freelancer. com. This site is for technical programming issues.
18 Mar 2023 by Vis Kataboman
I need to script VB6.0 gui and use grbl on Arduino for CNC functions I am trying to build a GUI on VB 6.0 that can run a 3 axis CNC router. I realise VB6.0 is old but, its still the easiest and the least problematic functionable GUI creator. ...
18 Mar 2023 by Dave Kreskowiak
How many times have you posted this and you STILL haven't explained what EXACT problem you're having? All you have to do to find out how to read a text file in VB6 is Google for "VB6 read a text file" and start reading. And if you start asking...
11 Mar 2023 by OriginalGriff
This is the same question you asked 5 days ago: How do I script a VB6 GUI to run G-code[^] The answers don't change because you repost them...
17 Feb 2023 by Mr.Kim2050
Hi all I have some problem with code below which i search from google, this code is writing in vb6 but i need to rewrite and edit it in Visual Studio 2017. I meet some problem below Code Error 1: Public Function getHTML(address) ...
15 Feb 2023 by landv li
viusal basic 6.0 use RDPCOMAPILIBCtl com component, rdpviewer connect prompts syntax error RDPCOMAPILibCtl.RDPViewer RDPViewer.Connect(Text1.Text,"administrator","1234") What I have tried: form1.frm VERSION 5.00 Object =...
14 Nov 2022 by Member 11291660
It is a VB6 project connected with Ms access database(.accdb). The table has separate columns for DATE and TIME. Below is the table TABLE : tblSales +------------------------------------------- ---+ | ID | PRODUCT | DATE | TIME...
14 Nov 2022 by OriginalGriff
If you are storing dates and times separately, then the most likely thing is that your are storing them as VARCHAR or NVARCHAR fields, and that's a huge mistake: use a single DATETIME field instead, and a lot of problems will go away. Text based...
13 Oct 2022 by OriginalGriff
This is the same question you asked yesterday: In VB.NET how to remove print icon in printpreview page?[^] The answer will not change no matter how many times you ask it.
7 Oct 2022 by Member 13532114
Dim stdate As String Dim edate As String Adodc1.RecordSource = "SELECT * FROM StockRun WHERE format(SDate,'MM') Between '" & Format(DTPicker1.Value, "MM") & "' And '" & Format(DTPicker2.Value, "MM") & "'" Adodc1.Refresh ...
7 Oct 2022 by Snjana143
Private Sub Command1_Click()Call dbConnect SQL = "SELECT * FROM Expences WHERE ((('Month') Between # " & DTPicker1.Value & "# And # " & DTPicker2.Value & "#))" RS.Open SQL, Conn, adOpenForwardOnly, adLockReadOnly With DataReport5.Sections("Section1").Controls 'section1 mean...
6 Oct 2022 by CHill60
It's highly likely that you are using something from the Extended Runtime package for VB6 which is not shipped with the OS and must be distributed with your application (or separately downloaded to the target machine). You can get hold of the...
6 Oct 2022 by basitsar
Hi, I have two pc on network OS windows 10 with same version, when use vb6.0 application then one of windows 10 pc exe file got stuck while retriving data from database, while other pc with windows 10 working normal. regards, Basit. What I...
5 Oct 2022 by OriginalGriff
We can't help: we have no idea what the applications are, what they do, how they do it, how the environments are configured, or any actual information about them other than "I have an app. It works on computer A, but doesn't on Computer B". You...
2 Oct 2022 by Member 13322574
HOW I CAN PRINT DATAREPORT FROM CUSTOM PAPER SETTINGS What I have tried: Printer.Width = 5000 Printer.Height = 5000 REC.Open "select * from rcpt where rcptno=" & Text1.Text, VAR Set DataReport72.DataSource = REC Call...
29 Sep 2022 by saify mian
I have tried to convert one of my Visual Basic 6 programs to Visual Basic.NET. This program basically crawls email and mobile number data from a web page link. This program works great in Visual Basic 6 but after converting to Visual Basic.NET is...
29 Sep 2022 by OriginalGriff
If you are going to scrape websites in VB.NET, then use the HTML Agility pack[^] - it's free, and makes processing HTML data and extracting the stuff you are interested in a whole load easier. It'll make your app a lot more flexible and easier...
29 Sep 2022 by Dhanish Balloo 2021
So, basically I have a DLL written in C# that has a main class called Program.cs that contains a public function getSignature. I need to import and use that DLL in 2 applications; 1 in VB.NET and another in VB6. In the VB.NET application, I...
29 Sep 2022 by Dhanish Balloo 2021
Finally got it working. I was missing an Interface in the project. Added this and linked where needed and pooof......it worked :D
28 Sep 2022 by Gerry Schmitz
Call Into The .NET Framework From Existing Visual Basic 6.0 Apps | Microsoft Learn[^]
26 Sep 2022 by MrG_
For what it is worth, I managed to resolve this. Extracts of the relevant code: from comtypes import c_double, c_short, client from ctypes.wintypes import VARIANT_BOOL from comtypes.automation import _midlSAFEARRAY my_dll =...
26 Sep 2022 by MrG_
Hi all, I have a 32bit VB6 DLL which has two functions. I want to access those functions from my 32bit version of python. First issue is that I can't seem to see the functions when I load the dll: from ctypes import * dll =...
16 Sep 2022 by dharmendra dalwadi
i have other.exe when i open/run then it look like row and column, so i want to pass numeric value on that using vb What I have tried: i tried in vb.net but i cant understand how to do
16 Sep 2022 by OriginalGriff
You are going to have to be an awful lot more detailed about this - you are just far too vague with the question to get any real help. Start by thinking about the two applications: does your app start the other? If it does, you may be able to...
16 Sep 2022 by Richard MacCutchan
See SendKeys.Send(String) Method (System.Windows.Forms) | Microsoft Docs[^].
6 Sep 2022 by gayathri bhat
I need to create onscreen keyboard which can be used for other application by calling the execution file. What I have tried: I have tried with help of sendkeys and appactivate.But in the appactivate we need to give the process name like...
6 Sep 2022 by OriginalGriff
The problem is that the keypad is an application, and if you are interacting with it (touch or click) then it is the "active application" and Windows doesn't store a "last application active" for you to reference - even if it did, it would...
30 Aug 2022 by Gizachew Eshete
>how to insert a unicode character such as amharic in sql server db from web application form nvarchar data types accepts the value back end but not from the app. All I need is to read the values from the form and insert into the db table. It...
30 Aug 2022 by Maciej Los
If you're using VB6, please read this: https://www.vbforums.com/showthread.php?365738-Classic-VB-Does-Visual-Basic-6-support-Unicode[^]
23 Aug 2022 by gary hagerty
Hello All, I need help to display chinese characters in my VB6 application. I have a file that contains my text strings and corresponding chinese characters, please see the following: ABORT|停止 FAIL|失敗 BACKUP|&上一步 OK|確定 Pipe symbol seperates...
23 Aug 2022 by OriginalGriff
Unfortunately, this is an English site, so most of the membership can't read Chinese - which wis what Google Translate says your text is - and as a result, we do not have the font you refer to installed - though "Microsoft JhengHei" is available...
22 Aug 2022 by Maciej Los
Well... i'd simplify that... The idea is as follow: rsReport.Open sqlreportForNameLucy, wsDB 'then... wbReportForNameLucy.Range("A2").CopyFromRecordset rsReport rsReport.Open sqlreportForNameAmir, wsDB 'then......
22 Aug 2022 by Member 14670863
Hi,right now I already create new Excel workbook. BUT, I want to split the data to new worksheet based on column. In my case, at the first sheet, it has 3 column:: Name, Order and Price. And, I want column Name for value 'Lucy' remain same...
22 Aug 2022 by CHill60
Set up variables for each sheet and initialise them e.g. Dim wsReportLucy As Worksheet, wsReportAmir As Worksheet Set wbReport = excelApp.Workbooks.Add Set wsReportLucy = wbReport.ActiveSheet 'Sheet1 ...
21 Aug 2022 by Member 14670863
Hi, I am having some problem which is right now I had transfer my data into excel. But, since my computer no longer support xls, i need to convert to xlsx. Here is my coding 'Declaration for XLS Dim excelApp As New...
14 Aug 2022 by sunil pol
I have written code in c# and vb.net but now the requirement is vb6.Can i convert vb.net code to vb6.How to add namespace in vb6 System.Security.CryptographyImports System.Collections.GenericImports System.LinqImports System.TextImports System.Security.CryptographyImports...
12 Aug 2022 by zs zs
I want this expression **x{y{z}}** to be parsed as * x start y start z y end x end * please help writing code in C#, C++, JavaScript, VB.net,Java What I have tried: Dim p As String Dim s As String = "x{y{z}}" Dim sc As...
12 Aug 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
8 Aug 2022 by Ramanath Mahato
i want printer = Quality1\BARCODE_PRAKASH paper size = 24.9mm x 80.0mm paper margin = (0,0,0,0) What I have tried: Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click ...
5 Aug 2022 by Member 11291660
I have used VB6 one module for encryption / decryption and compare the encrypted string with another string which always say Not Matched. Below is the code What I have tried: Dim a As String a = modEncDec.AesEncryptString("a", "PASS") '...
5 Aug 2022 by Member 11291660
Dim a As String Dim b As String a = modEncDec.AesEncryptString("a", "PASS") b = "tA==" a = Replace(a, vbCrLf, "") If a = b Then MsgBox "The Value of a is " & a & vbCrLf _ & "The Length of a is " & Len(a) & vbCrLf _ & "The Value of...
5 Aug 2022 by Fueled By Decaff
It looks like you are encrypting the string "a", decrypting it and then comparing it to the string "tA==". Try comparing to the string "a" instead and see if that works.
4 Aug 2022 by OriginalGriff
The chances are that the problem lies in the use of strings: AES encryption does not generate a string but a stream of byte values which is not the same thing. VB6 internally used Unicode for string storage, which is a multibyte character, so...
4 Aug 2022 by 0x01AA
You need to specify the file format explicitely. This works for me: private void buttonExcel97_Click(object sender, EventArgs e) { string safeExcelFilePath = @"c:\temp\cp.excel"; string excel97File =...
9 Jul 2022 by v_tigra
Hey guysI try to explain my problem:I have a main form named frmMain, and other forms named frmOne and frmTwo.The form frmMain opens frmOne. FrmOne opens frmTwo.What I would like to have: when frmOne opens frmTwo, I should not be able to click on the form frmOne (so I have to open...
7 Jul 2022 by Purnendu Paul
Respected, In a stock Management project (VB6.0) I'm fetching a problem during updation of a table in respect of another table in same database (MS ACCESS). Netstock Table: Category Item Variant Brand P_Qty S_Qty Unit Gel Pen Agni...
7 Jul 2022 by CHill60
Look at your sub-query SELECT Inward.Item, Inward.Category, Sum (Inward.P_Qty) From Inward GROUP BY Inward.Item, Inward.Category, Inward.Brand It is returning 3 columns in the result set, yet you are trying to assign all three values to a single...
2 Jun 2022 by Member 13067459
I want validate international phone number in vb6 without using regular expressions only () + this charactersand numeric are allowed and it shold be below 20 digits. What I have tried: private sub txtPhoneNo_validate ( cancel As boolean) if...
2 Jun 2022 by Richard MacCutchan
You need to examine each character in turn. If it starts with a plus sign, then the next digit(s) are the international country code. That may or may not be followed by a number in parenthesis which is the internal long distance indicator. That...
2 Jun 2022 by Member 15627495
private sub txtPhone_check() if not isnumeric(txtPhone) or len(txtPhone) > 20 then msgbox "Error in Phone Number" end if end sub to avoid redundancy, see that var = "" is equal : len(var) = 0 you don't need to test it twice, isnumeric...
31 May 2022 by Aravindba
Hi, First spilt pan numbers and pass the spilt values for each functions for verify it, Here all function must return false, otherwise PAN number is incorrect. In fourth position i pass characters to check as "ABCFGHLJPT", bcz u mention 4...
31 May 2022 by Member 13067459
0 Wrote a function to validate pan card. Pan should 5 characters followed by 4 numeric and a character. I am validating 4 position but I want show error message for test4 --- Testpan(PanNo) calling function Function TestPan(PAN As String)...
31 May 2022 by OriginalGriff
You can use Regular Expressions in VB6: Regular Expressions in Visual Basic 6 - VB RegExp[^] Then it's pretty simple: ^[a-zA-Z]{5}\d{4}[a-zA-Z]$ will match your criteria in a single line of code ...
31 May 2022 by Member 11207670
I'm converting some programs from Visual Basic 6.0 to Python, and I'm stuck in one line in VB. Visual Basic code:bAddStart = "100"bNoOfBytes = "94"MeterId = 1Data = Chr(MeterId) + Chr(3) + Chr(Val(bAddStart) \ 256) + Chr(Val(bAddStart) Mod 256) + Chr(0) + Chr(Val(bNoOfBytes))For...
31 May 2022 by Member 15624430
if we use int() function as below, you will get the perfect answer. str_no = "12345" no = int(str_no) * 1 print(no) print(no + 1)
13 May 2022 by Member 15635045
Eu adaptei uma funcao usada para a substituicao de letras acentuadas por letras sem acento, para que os caracteres especiais "[+^%~()]" fiquem entre chaves. Segue abaixo a funcao adaptada. ...
12 Apr 2022 by Vasanthan A9UCP078
Option Explicit Public LoginSucceeded As Boolean Private Sub cmdCancel_Click() 'set the global var to false 'to denote a failed login LoginSucceeded = False Me.Hide End Sub Private Sub cmdOK_Click() rs.Open "SELECT * FROM...
2 Apr 2022 by Member 9603318
How to use the do while loop in vb6.0???? Please help me!!!!!!!!!!!!