Questions tagged [vb6]

Visual Basic 6.0 (VB6) was the final COM-based version of the VB programming language and IDE, last updated in 2004. It is the predecessor to the modern VB.NET.

Visual Basic 6.0 () is the third generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. It is also considered a relatively easy programming language to learn and use, because of its graphical development features and BASIC heritage.

The final release of the COM-based Visual Basic was version 6 in 1998. It was last updated in 2004 through Service Pack 6.

  • The designated successor language is . For things like writing COM addins for Microsoft Office you would use or .
  • Support for the VB6 IDE ended on April 8th, 2008.
  • The runtime is supported as part of Windows Vista, 7, 8, 8.1 and 10 and Windows Server 2008, 2012 including R2 and 2016.

Resources:

10799 questions
57
votes
3 answers

Add newline to VBA or Visual Basic 6

I want to concatenate two strings with a linebreak between them. st = "Line 1" + newline + "Line2" How do I add a newline to VBA or Visual Basic 6?
Gerhard Powell
  • 5,965
  • 5
  • 48
  • 59
56
votes
8 answers

What is the difference between Sub and Function in VB6?

I am going through some old VB code and I run into function definitions like these - Private Function ExistingCustomer(Index As Integer, Customer As String) As Integer Private Sub cmdCustomerList_Click() What's the difference?
CodeBlue
  • 14,631
  • 33
  • 94
  • 132
54
votes
6 answers

How can I make mousewheel work in VB6 IDE?

One annoying behavior of the VB6 IDE editor, especially when switching back to it from more recent tools like VS.NET, is that it doesn't recognize the mousewheel! Maybe VB6 was brought out when most mice didn't have one, but is there a way to fix…
Starwatcher
  • 832
  • 1
  • 6
  • 8
53
votes
9 answers

Should I use Call keyword in VB/VBA?

I use the Call keyword when calling subs in VB/VBA. I know it's optional, but is it better to use it or leave it off? I've always thought it was more explicit, but maybe it's just noise. Also, I read this on another forum: Using the Call keyword…
Fred Loyant
  • 531
  • 1
  • 4
  • 3
52
votes
6 answers

Is there a Visual Basic 6 decompiler?

I lost the source code from one project I did on the company I'm working for and haven't been able to find a Visual Basic 6 decompiler; does that even exists? I only have the EXE that I've rescued from a user's machine.
Rismo
  • 6,487
  • 11
  • 37
  • 33
49
votes
3 answers

Escape double quote in VB string

I have used following piece of code to execute schtasks command from VB6. While executing it, ignores folder if they contains spaces. For example, "C:\program files\test\test.exe" will be converted to "c:\program ". How do I solve this…
Suriyan Suresh
  • 2,964
  • 14
  • 51
  • 80
48
votes
17 answers

VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323

After windows update installed security update KB2687323, my VB6 project fails to load. Displayed error message is "'[project_vbp_path]/MSCOMCTL.OCX' could not be loaded--Continue Loading Project?". Note that the path in the messeage is the vbp file…
Rumi
  • 1,290
  • 1
  • 11
  • 17
45
votes
10 answers

VB6 Editor changing case of variable names

I'm not much of a Visual Basic person, but I am tasked with maintaining an old VB6 app. Whenever I check out a file, the editor will replace a bunch of the uppercase variable names with lowercase automatically. How can I make this stop!? I don't…
Laure
  • 531
  • 1
  • 6
  • 11
45
votes
1 answer

Implementing String.Format() in VB6

Can String.Format() be implemented in VB6, at least a close-enough version of it that could be useful when programming in good ol' VB6? Good resource on the matter of VB6 string manipulation performance:…
Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
44
votes
16 answers

Is There a JSON Parser for VB6 / VBA?

I am trying to consume a web service in VB6. The service - which I control - currently can return a SOAP/XML message or JSON. I am having a really difficult time figuring out if VB6's SOAP type (version 1) can handle a returned object - as opposed…
Ben McCormack
  • 32,086
  • 48
  • 148
  • 223
44
votes
5 answers

Is there a way to display line numbers in the VB6 / Visual Studio 6.0 IDE?

In the VB6 / Visual Studio 6.0 IDE, is there a way to display line numbers in the code editor like there is in recent versions of Visual Studio .NET? For example, I would like to ask someone a question about their code and be able to say "In lines…
Ben McCormack
  • 32,086
  • 48
  • 148
  • 223
42
votes
13 answers

VB6 Running on Windows 8?

Assuming that vb6 does not run on Windows 8 because the VB6 run time libraries are not shipped with Windows 8, would it not be possible to install the VB6 run time library on Windows 8 and then then run VB6? Or is there another problem?
Clinton Reilly
  • 435
  • 1
  • 6
  • 10
42
votes
5 answers

GetWindowRect returns a size including "invisible" borders

I'm working on an app that positions windows on the screen in a grid style. When Running this on Windows 10, there is a huge gap between the windows. Further investigation shows that GetWindowRect is returning unexpected values, including an…
Deanna
  • 23,876
  • 7
  • 71
  • 156
42
votes
4 answers

A Simple C# DLL - how do I call it from Excel, Access, VBA, VB6?

I have a simple class library written in c#. using System; namespace TestDll { public class Test { public string HelloWorld { get { return "Hello World"; } } …
divinci
  • 22,329
  • 11
  • 45
  • 56
41
votes
3 answers

In VB6 what is the difference between Property Set and Property Let?

I have just created several Property Set methods, and they didn't compile. When I changed them to Property Let, everything was fine. I have since studied the documentation to find the difference between Property Set and Property Let, but must admit…
Brian Hooper
  • 21,544
  • 24
  • 88
  • 139