Visual Basic Classic

163K

Solutions

58K

Contributors

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

Share tech news, updates, or what's on your mind.

Sign up to Post

Since Windows 10 Creators Update we are facing problems with an VB6 Application which does not run anymore. The application is starting and is ending in a part of a second. We found out that several person are facing the same problem due to a function "MKDIR" in VB6. We tried it out but that was not the reason in our environment. We do not have this problem with a former built of Windows 10.

Does soembody has an idea?

Thanks.
0
Revamp Your Training Process
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Hi
I am not a programmer and know nothing about programming but I need a little help if anyone could?

I have an old XP program which has no support anymore... It runs an MS Access database which I can access

I want to increase the size of the text on my printer

In the database there are lines like this CHR(27)+CHR(33)+CHR(1)  which I may or may not be correct in assuming they effect the printer output

Is there a way to increase the text output to the printer using the Access database ?
ID      PrinterName      PrinterType      FullCut      PartCut      DelayBeforeCut      Activate      NormalPrint      LargePrint      XLargePrint      OpenTill
1      AXIOHM A714      1      CHR(27)+CHR(105)      CHR(27)+CHR(109)      5      CHR(27)+CHR(68)+CHR(20)+CHR(0)      CHR(27)+CHR(33)+CHR(1)       CHR(27)+CHR(33)+CHR(33)      CHR(27)+CHR(33)+CHR(49)      "CHR(27)+""p""+CHR(0)+CHR(255)+CHR(25)"

This is the data in Access.

I need normal print to be large? Can I just swap the codes?

Would that work?

Is there anyway to access the actual program to change the settings if not?

Regards

Paul
0
I had to change the computer I use for my vb6 programming.  When I try to re-compile a module I get a Break compatibility warning.

Old Computer:  Win 10
New Computer: Win 7

Below is the reason for the compatibility issue:

Original Definition:
Property Set to Connection(RHS As ADODB.Connection_Deprecated)

Current Definition:
Property Set Connection(RHS As ADODB.Connection)

Question:
Where does Set Connection(RHS As ADODB.Connection) come from and how do I set it to Connection(RHS As ADODB.Connection_Deprecated)
0
Hi Everyone,
 
I am using one VBS which delete and Insert records from Excel. But need some adjustments here.
For example this script deleting 10 records and inserting 10 records into Excel, but replicating some records again at right side again and again after each run.
And my Excel has 3 multiple Sheet, but I need to insert into a particular sheet i.e. Sheet2
 
after execution I am seeing these defects
1. Legends moved to somewhere else,
2. row 1-6 repeated but right side.
 
Here is my CSV data.
But after second run data got inserts some other place.
 
Name,Location,Phone,Comment1,Comment2,comment3
"ABC","Pune",123,"Expert Value","! Easy","Popular"
"XYZ","Kol",567,"! Expert value",Easy,"!Credit"
"PQR","Mum",234,"NOT value","Value for money","Debit"
"RST","DEL",0,"Value","NO value","N/A"
"Ram","KOL",100,"NO Value","value","N/A"
"XYZ","Kol",567,"! Expert value","!Easy","!Credit"
"qwer","DEL",567,"Expert value","Easy","!Credit"
"cvbn","Pune",567,"! Expert value","!Easy","!Debit"
"rtyu","DEL",567,"! Expert value","Easy","!Credit"
"kllo","Pune",567,"Expert value","NOT Easy","!Bad"

Open in new window


Here is my existing VBS.
 
srccsvfile = Wscript.Arguments(0)
tgtxlsfile = Wscript.Arguments(1)
 
'Create Spreadsheet
'Look for an existing Excel instance.
On Error Resume Next ' Turn on the error handling flag
Set objExcel = GetObject(, "Excel.Application")
'If not found, create a new instance.
If Err.Number = 429 Then  '> 0
  Set objExcel = 

Open in new window

0
Hi Guys, I have a Macro called PL Star Summary on the "Control" tab which uses a Worksheet Function which adds up data in a Tab of the attachment called "PL Star IMM_FX_Trading" by Portfolio name and populates a summary of the data. 3 Portfolios called FX_FLOWS_PR, PB_FX_PR & RETAIL_FX_PR should be WORKSHEETFUNCTION(SUM * -1) so an IF statement needs  to be inserted into the code whereas all the other Portfolios will remain SUM* 1. The subprocedure is called "CalculateNumbers" and looks like this:

Sub CalculateNumbers(ByVal strSheetName As String)
    Dim intTyplogolyCol As Integer
    Dim intPFCol As Integer
    Dim intPLCol As Integer
    Dim strPLColName As String
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    Dim intHeaderPFCol As Integer
    Dim intHeaderPLCol As Integer
    Dim strHeaderPFName As String
    Dim strHeaderTypologyName As String
    Dim rRange As Range
    Dim dblPL As Double
    Dim strRange As String
    
    Sheets(strSheetName).Select
      ActiveSheet.AutoFilterMode = False
    If strSheetName = "PL Star MTM" Then
        intTyplogolyCol = 7
        intPFCol = 4
    End If
    If strSheetName = "PL Star IMM_FX_Trading" Then
        intTyplogolyCol = 7
        intPFCol = 4
    End If
    
    If strSheetName = "PL Star Accrual" Then
        intTyplogolyCol = 7
        intPFCol = 4
    End If
    
     If strSheetName = "PL Star MTM Accrual" Then
        intTyplogolyCol = 7
        intPFCol = 4
    End If
    
    'Get PF & 

Open in new window

0
I am making slow progress with my treeview. The latest problem is the first child node repeating until Access give an error 3014 'Can't Open Any More Tables'


Capture-6.PNG
What am I doing wrong?

Private Sub addChildren(tv As TreeView, nodParent As node, rsReqs As DAO.Recordset, lngParentID As Long)
   Dim strFind As String
   
   Dim strSQL2 As String

  Set rsReqs = CurrentDb.OpenRecordset("Query2")
   
   
   strFind = "HeaderID=" & lngParentID
   rsReqs.FindFirst strFind
   Dim nodX As node
   Dim strBook As String
   rsReqs.MoveFirst
    Do While Not rsReqs.NoMatch
      Set nodX = tv.Nodes.Add(nodParent, tvwChild, , Left(rsReqs!StockCode, 50))
      strBook = rsReqs.Bookmark
      addChildren tv, nodX, rsReqs, rsReqs!HeaderID
      rsReqs.Bookmark = strBook
      rsReqs.FindNext strFind
   Loop
   
   
   
   
End Sub

Open in new window

0
I need to archive each mail via specific account each time its received or send. For received mail i use this script:

Public Sub SaveMsgInbox(Item As Outlook.MailItem)
  Dim sPath As String
  Dim dtDate As Date
  Dim sName As String
  Dim enviro As String
 
  enviro = CStr(Environ("USERPROFILE"))
   
  sName = Item.Subject
  ReplaceCharsForFileName sName, "_"
 
  dtDate = Item.ReceivedTime
  sName = sName & ".msg"

   sPath = "Y:\mail_arhiva\msg_arhiva\Inbox\"
  Debug.Print sPath & sName
  Item.SaveAs sPath & sName, olMSG
End Sub
 
Private Sub ReplaceCharsForFileName(sName As String, _
  sChr As String _
)
  sName = Replace(sName, "/", sChr)
  sName = Replace(sName, "\", sChr)
  sName = Replace(sName, ":", sChr)
  sName = Replace(sName, "?", sChr)
  sName = Replace(sName, Chr(34), sChr)
  sName = Replace(sName, "<", sChr)
  sName = Replace(sName, ">", sChr)
  sName = Replace(sName, "|", sChr)
End Sub

Open in new window


However, I cant make outlook 2010 run a script when i send mail. Otherwise i would use same script just different save path.

Edit: Code put into a snippet box. Graham Skan
0
bjr.  je suis étudiante et ma thèse de soutenance porte sur SDWAN, SDN, NFV ,VNF.  besoin d'aide ou des sites qui pourront m'aider
0
I have two macro that I created that I would like to combine them into one Macro using a command button in Excel from the Mod Cost Calculator tab in Excel.  The first macro comes from the Excel Tab titled, "Database Tab", and the second Macro reference excel tab Data position Tab.  Please help me!
Sub ADOFromExYoucelToAccess()
' exports data from the active worksheet to a table in an Access database
' this procedure must be edited before use
Dim cn As ADODB.Connection, rs As ADODB.Recordset, R As Long
' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "provider = Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=R:\Modular Cost Tables\FY 2018A\RCA Database Prep\Terry's Updates\FY 2018 AOP RCA Database_062717_SCOPS Locations.accdb;"
 ' open a recordset
Set rs = New ADODB.Recordset
rs.Open "[FY18 Fee Review Mod Cost Table Data]", cn, adOpenKeyset, adLockOptimistic, adCmdTable
' all records in a table
R = 2 ' the start row in the worksheet
Do While Len(Range("A" & R).Value) > 0
    ' repeat until first empty cell in column A
    With rs
        .AddNew ' create a new record
        ' add values to each field in the record
        .Fields("Project_ID") = Range("A" & R).Value
        .Fields("Item") = Range("B" & R).Text
        .Fields("Object_Class") = Range("C" & R).Text
        .Fields("OC_Name") = Range("D" & R).Text
        .Fields("ProjectTask") = Range("E" & R).Text
        .Fields("Fund") = Range("F" & R).Text
        .Fields("Prog") = Range("G" & 

Open in new window

0
Hi All,

Can any one help me in building a code to login https://leadferret.com/login using either WinHTTP or msxml2.xmlhttp request? Using IE Automation I got success but its very slow.

Purpose: Pull information from a web page. (Specifically Email ID here)
Issue: Without login it gives me partial information while gives rest of the information on a web page post login.

Demo Url: https://leadferret.com/directory/person/kristen-knapper/217985

Regards,
Niraj Patel.
0
Online Training Solution
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Hi, I am new to this place. I want to know about internals of vb6. I would like to know the memory layout of a vb6 control like a command button or UserControl etc. How data fields are stored, and how system access those while running the vb6 application.
0
I want to download Google Mutual Fund historical data. This code snipit works fine:

      With ActiveSheet.QueryTables.Add(Connection:= _
         "URL;https://www.google.com/finance/historical?cid=298525784073028&startdate=Jun+26%2C+2016&enddate=Jun+22%2C+2017&num=200&ei=6GtRWbGxFNaO2AbylaCIBw", _
         Destination:=Range("$A$3"))

But, I would like to change the cid code, startdate and enddate to variables but everything I try doesn't work. Example,

changing the cid code to a string:

      id = 298525784073028
      With ActiveSheet.QueryTables.Add(Connection:= _
         "URL;https://www.google.com/finance/historical?cid=&id&&startdate=Jun+26%2C+2016&enddate=Jun+22%2C+2017&num=200&ei=6GtRWbGxFNaO2AbylaCIBw", _
         Destination:=Range("$A$3"))
0
Program compiled with tabctl32.ocx  placed on VMWare station
If I try to run using RDP session to that station wil get error (see attached)
if i run same location using Teamviewer no problem!
0
I have some textbox and a listview on my form, when I click the add button, I Want the items on this control to be added to a single roll in access database, is it possible in vb6.0
0
I have this code which will find matching sets of three numbers (and colour them for ID) across a worksheet. (sample sheet attached 007-quad-ID-query-ee.xls )

Could it be adjusted to find those sets of three numbers which match 5 or more times ?
__________________________
Code :

Option Explicit

Private Type Sets
    strAddr As String
    strCells As String
    lngColor As Long
End Type

Sub IdentifyDuplicates()

    Dim lngLastRow As Long
    Dim lngLastColumn As Long
    Dim lngRow As Long
    Dim lngCol As Long
    Dim DupeSets() As Sets
    Dim strSet As String
    Dim lngFind As Long
    Dim lngFound As Long
    Dim lngColors()
    Dim lngNextColor As Long

    lngColors = Array(13494512, 11599871, 13626575, 15723724, 15258845, 12178907, 8518399, 11461045, 14667418, 14136257, 10074816, 5369343, 9491089, 14071663, 12683685, 13233150, 11596768, 14541491, 15259071, 15654653, 10668797, 7791807, 12504966, 13674644, 13743867, 8759804, 6146693, 10728776, 12552565, 11963641, vbYellow)
    lngNextColor = 0

    ReDim DupeSets(0)
    lngLastRow = Range("A65536").End(xlUp).Row
    lngLastColumn = Cells.Find("*", SearchOrder:=xlByColumns, LookIn:=xlValues, SearchDirection:=xlPrevious).Column

    For lngRow = 4 To lngLastRow
        If Cells(lngRow, 1) <> "" Then
            For lngCol = 8 To lngLastColumn Step 4
                strSet = Cells(lngRow, lngCol) & "," & Cells(lngRow, lngCol + 1) & "," & Cells(lngRow, lngCol + 2)
                …
0
Hi. I am using the Bloomberg COM v3 Data Control code in their RefDataExample.xls to retrieve BID and LAST_PRICE_TIME_TODAY for a list of bond ISINs. I need the data to be returned in the same row as the ISIN for which the request has been made. However, if a bad ISIN is in the list the results seem to be returned in a fairly random way. If I then do nothing else but rerun the macro the order of the returned data changes. I am not an expert. Anyone got any bright ideas? Thank you very much.
The problem is best seen by using simple numbers for the ISIN input column of 1 to, say, 100 and seeing how the output is returned to the right of the input column.
This has been answered by Bberg now. Thanks
0
I have an application running in classic ASP coding with HTML pages and in one .asp page the client requested for a button. This button when clicked, it must export whatever the data present in Table of Access database (already in use) to an excel sheet. Kindly help as i have been searching for this sort of code everywhere.
0
Hi All,

Have a problem and need help here. i am using vb6 and now face 2 problem .
1. Need to split the string into variable from CSV file but the data may contain comma in quote, which is -
 
            - string = abc,"3,4,5,6","3",Steve,got,"1,2,3",problem
             
             * i want to split into 6 variable to become
               
                aVar = "abc"
                bVar = "3,4,5,6"
                cVar = "3"
                dVar = "Steve"
                eVar = "got"
                fVar = "1,2,3"
                gVar = "problem"

2. i want to sort the string in 2 element, which is sort bVar then follow by fVar.

Anyone able to advice,

thanks in advance.

Regards
Steve
0
is it possible to programatically create a computer to computer voice chat using classic vb or vb.net through internet?

e.g. suppose two computers A in UK and B in USA
computer A is a server  which is connected to a client computer B
at the same time
computer B is a server  which is connected to a client computer A

the user on Computer A Sayes: hellow
    1- the sound is converted to a file (..wav)
    2- the wav file is immediatly sent to computer B winsock
    3- Computer B winsock recieves and play the voice
the user on Computer B Sayes: How Can I help
    1- the sound is converted to a file (..wav)
    2- the file is immediatly send to computer A winsock
    3- Computer A winsock recieves and play the voice
and so on

Because both are servers and clients at the same time then they can both talk at the same time and also listen.

or may be there is a tool better that winsock that does the job, open channel and deal with the voice .....
0
On Demand Webinar: Networking for the Cloud Era
LVL 9
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Hey guys,

I have a report on Excel that is linked to a specific Powerpoint presentation, and as the Excel file is frequently updated with new data, I would like to add a VBA code in order to:

1. Open the wanted Powerpoint file
2. Update all the links
3. Break all the links
4. Save the Powerpoint presentation as a new & separate file

This way I can easily send those reports quickly without having to change the original PPT file.

I'm pretty new in the VBA world so any help will be HUGELY appreciated :)

Many thanks!!
0
Hi all...
I'm new to programing and encryptation...
I need to encrypt the contend of a file, i had a look on the net and found 2 functions:
1° Uses RijndaelManaged, SHA512, with password, salt, hash
2° Uses RijndaelManaged, MD5CryptoServiceProvider with password

Mi question is if i encrypr the contends of the file with the first one, the convert encrypted to Hexadecimal and encrypt again with the second one will it easy to crack it?
I dont know if it makes sence or if i m saying it something realy stupid but...

Thanks in advance
0
Dim PubApp As Object
    Set PubApp = Publisher.Application
    PubApp.Open "C:\Users\David\Documents\............"
   
     PubApp.Visible = True
0
Hi

We have In House Team Foundation Server (2010) for Source control

I am planning to upgrade entire development on Cloud / Hybrid.  

How easy to migrate TFS2010 on Visual Studio Team Services on Cloud?  Will it migrate entire History and also include legacy projects?
How about team members, which are now controlled through Active Directory (Domain Network)


Has anyone done this before, could you please suggest a detailed plan?

Thanks in advance

Best regards
0
Hi Experts,

This issue relates to one of our VB6 applications that is installed on dozens of user PCs.

We are using DAO 3.6.

One user has just installed the application on a Windows 10 PC and has reported this issue.

We have checked that his .mdb files work fine at our end.

Regards,
Leigh
0
Hi! I use mjwPDF  in VB6   to create pdf file.  Can you give me a code for align text in pdf file? I import text from textbox with multiline.
Thx
0

Visual Basic Classic

163K

Solutions

58K

Contributors

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.