r/visualbasic • u/Chemical-Fox-6681 • Jun 24 '25
VB.NET Help 'OleDb.OleDbConnection' is not defined. 'OleDb.OleDbDataAdapter' not defined.
I did change the cpu to ×64. My access is 2013. Is that why? Help me please
r/visualbasic • u/Chemical-Fox-6681 • Jun 24 '25
I did change the cpu to ×64. My access is 2013. Is that why? Help me please
r/visualbasic • u/Scary-Scallion-449 • Jun 23 '25
I just want to add a CastingDevicePicker to a Forms application and it's become a Kafkaesque nightmare. Official Microsoft documentation is useless and sends you off to code samples that are in C# (so not helpful). The sample application hides the code beneath layers and layers of obfuscation. AI gives me code invoking properties that aren't implemented. And so the maze expands.
All I want is just the bare bones skinny on what Imports I need (if any) and the necessary code to create and show a CastingDevicePicker on a simple form. Anybody?
r/visualbasic • u/NoJicama2910 • Jun 20 '25
Hello everyone,
I am working on a project where I need to modify a program's logic that enforces a specific limitation. The program displays an error message (e.g., "Max number of characters is 10") when a certain input exceeds the allowed character limit.
Here’s what I’ve done so far:
I found the error message in the program's executable file using a hex editor and modified the text to display a new limit (e.g., "Max number of characters is 18").
However, this change only affects the display message and does not actually change the underlying logic that enforces the 10-character limit.
I would like to locate and edit the logic where the character limit is enforced. I assume this involves identifying the validation function and modifying the comparison value in the executable file.
Here’s what I know:
The error message string is stored in the binary, and I can trace its location.
The character limit is likely enforced using a numerical comparison (e.g., CMP or similar instructions).
I’d appreciate any guidance on:
How to trace the logic from the location of the error message in the binary.
Tools and methods to locate the validation logic and modify the limit.
Best practices to avoid breaking other functionality.
I am currently using tools like a hex editor and am open to suggestions for debugging tools (e.g., x64dbg).
Thanks in advance for your help!
r/visualbasic • u/Toadstriker • Jun 15 '25
I'm returning to VB6 after 20 years, and have forgotten so much. I can't remember the name of a type of window that contained another window. The outer window had scrollbars on the right and bottom of the screen, so that if the interior window was bigger than the exterior one, you could scroll to where you wanted to. It's a frequently-encountered type of window often found in programming environments/IDEs.
I want to add that type of window to my project. Could someone tell me what it was called?
Thank you!
r/visualbasic • u/Infinite_Might_8318 • Jun 12 '25
I run a Jeopardy game night for my buddies and I'm trying to figure out how to make sure PowerPoint randomizes where the 3 Daily Doubles pop up. Unfortunately, I don't understand coding or anything so using VBA has been a nightmare. Does anyone know a VBA code that would randomize the location of the Daily Double slide every time I open up my PowerPoint?
I've tried Googling and asking co-pilot and I always get some variation of the code below. But when it comes time to run it, the DD never moves or I get some sort of error.
Sub ShuffleDailyDouble()
Dim slideCount As Integer
Dim dailyDoubleSlide As Slide
Dim randomPosition As Integer
slideCount = ActivePresentation.Slides.Count
' Find the Daily Double slide
For Each sld In ActivePresentation.Slides
If sld.Shapes.Title.TextFrame.TextRange.Text = "Daily Double" Then
Set dailyDoubleSlide = sld
Exit For
End If
Next sld
' Generate a random position for the Daily Double slide
randomPosition = Int(Rnd() * slideCount) + 1
' Move the Daily Double slide to the random position
dailyDoubleSlide.MoveTo randomPosition
End Sub
Sub Auto_Open()
ShuffleDailyDouble
End Sub
r/visualbasic • u/ragekiller2000 • May 30 '25
I am programming in VB Windows Forms App, for some reason i made a splash page and want to have the main form execute it but its not showing the splash page as an option? Help would be appreciated
r/visualbasic • u/SandHK • May 17 '25
I have an app with a lot of on screen objects spread out over several tab panels. The objects have been added organically, some here, some there, with no care to the order they were added. As a result the tabindex values are very messy.
Is there a way to automatically reset or redo the tabinex values based on position within the app?
r/visualbasic • u/SandHK • May 16 '25
I have googled and turned off everything that I find online yet the IDE still auto saves. Hasn't been a real issue until just now.
I have a nearly completed project where I wanted to experiment with some images/resources. Saved the project before changing anything. Made changes, broke the project, no problem I thought as I closed the project, canceled the do you want to save changes dialogue, reopened the project to find the changes just made are there and the project still broken.
r/visualbasic • u/nicholas_chye • May 15 '25
being wondering how to turn this feature on or off , can anyone kindly help me
r/visualbasic • u/Decent_Treacle7782 • May 13 '25
As a beginner in 2025, I'm currently learning Visual Basic 16.9 (VB.NET). I've recently started working through 'Mastering Microsoft Visual Basic 2010' by Evangelos Petroutsos and find the language and the Visual Studio IDE integration incredibly intuitive and straightforward. It's proving to be a very effective way to learn. My first programming language was C, which I learned to understand hardware logic and embedded systems (like STM32) as a hobby. However I don´t want to use C with GTK+ for GUI´s and websites. I first tried Python due to its popularity but found the use of a separate tool for drag-and-drop GUI design (like Qt Creator) alongside a Python IDE unintuitive compared to Visual Studio. I think VB.NET is well-suited for developing a wide range of applications. What do you think?
r/visualbasic • • May 01 '25
Around 1992-93 I was just getting into VB programming and on a visit home to see my parents I saw my dad was using a neural net library for Visual Basic. It was very rudimentary but could be trained to do simple pattern recognition. For example, one could train it to recognize smiley and frowny faces by drawing them in a box with the mouse and then labeling them happy or sad. After enough training data, the library could recognize a newly drawn face.
The library wasn’t limited to that - it would work on a wide variety of data. I don’t remember a lot but do remember the documentation talked the normal neural net talk: input/hidden/output layers, back-propagation, biases, weights, etc.
Does anyone remember such a library? The Googles and even perplexity aren’t finding anything.
I’m not sure but the publisher could have been in Florida.
I’m really just curious. This clearly has no use today.
r/visualbasic • u/mystical_siren • Apr 13 '25
r/visualbasic • u/Alarmed_Treacle8394 • Apr 11 '25
r/visualbasic • u/kuma_a_K • Apr 07 '25
The default one doesn't seem to do anything when I change the colors via properties panel or via code, and the current package I'm using, cuoreUI's datetimepicker is really buggy and often spawns completely offscreen. I was wondering if there was a different package with a customizable control. Its functionality doesn't need to be anything too fancy as long as its looks are customizable.
r/visualbasic • u/derjanni • Apr 01 '25
Oh boy, I haven't used it for decades. Awesome to see it is cross platform now. To be honest, it's quite fun and I somewhat liked doing it again. Super excited to see how it runs on Linux and the Mac. Anyone of you using VB on any other platform than Windows?
r/visualbasic • u/Last-Box-4973 • Mar 30 '25
I can’t figure out a way to make all my objects scale up with the form when I put it in full screen. The only way I have found is to go individually through every object and multiply its height/width by the scale factor, but I have like 60+ objects and that would take forever. Is there any other way to do it?
r/visualbasic • u/paulpjoby • Mar 30 '25
r/visualbasic • u/Catriks • Mar 24 '25
Hi,
I'm trying to make a macro for Inventor (CAD program) with VBA. The purpose is to creata PDF file, which is easy, and then to copy Google Drive link for it - so basically to click the button in the picture. Is this possible?
I made a similar macro for OneDrive, which was easy, since the URL is just the folder path + filename, but in Drive, it is a random identifier, so it would actually need the link.

r/visualbasic • u/kuma_a_K • Mar 21 '25
I need to display all properties that match a particular criteria and make it clickable so you can get more information on the property. Issue is idk how I would go about doing that. I tried making a template button and trying to duplicate in in an array of buttons, but it doesn't seem to duplicate it and only affects the template button.
Since the number of total properties is unknown I need some sort of way to duplicate either a panel or a button within code but idk how to. Help would be very appreciated.
r/visualbasic • u/Mayayana • Mar 20 '25
VB6 -- I wanted a quick, simple method to convert back and forth and found methods at VBSpeed and elsewhere. But the results seem to be wacky. I can't see any pattern in the numbers I'm getting. http://www.xbeat.net/vbspeed/c_RGBToHSL.htm Another method I found was using decimal values 0 to 1 rather than 0 to 255.
Then I tried API calls from shlwapi, ColorRGBtoHLS and ColorHLStoRGB. That works perfectly. But I'm wanting to walk the pixels of an image doing color operations. I'd prefer basic math to calling into a DLL. Does anyone know about this? I've used VBSpeed methods before and they've always been good. So I wonder if I'm missing something.
r/visualbasic • u/Due_Assumption3570 • Mar 17 '25
Hi, I was trying to install the library, then I got a message to update pip, which I did, but I got the following message: ERROR: Could not install packages due to an OSError: [WinError 5] Access denied: 'C:\Users\User\AppData\Local\Temp\pip-uninstall-a20qcncm\pip.exe'
Consider using the `--user` option or checking the permissions.
Could someone help me how to configure the necessary permissions? According to me, I already did it :'
r/visualbasic • u/KneecapVII • Mar 17 '25
Il funzionamento del mio programma è il seguente:
1. L'utente seleziona un file Excel da standardizzare
2. Una volta ordinate le colonne l'utente preme il pulsante esporta ed automaticamente i titoli delle colonne vengono rimpiazzati da quelli contenuti nel StandardColumnOrder e poi vengono ricopiati tutti i dati necessari.
Il programma in questo momento funziona correttamente ma quando viene selezionato un file che ha i titoli delle colonne diverse mi viene mostrato il codice d'errore 0x800A03EC, ma aprendo il file Excel generato non vedo alcun segno di malfunzionamento.
Qualcuno può aiutarmi a capire perchè mi viene mostrato questo codice d'errore ?
Private Sub BtnExport_Click(sender As Object, e As EventArgs) Handles BtnExport.Click
Try
' Percorso del file di destinazione
Dim famiglieDiScontoPath As String = iniFile.ReadValue("Percorsi", "FamiglieDiSconto")
Dim xlNewApp As New Application()
Dim xlNewWorkbook As Workbook
Dim xlNewWorksheet As Worksheet
Dim fileExists As Boolean = System.IO.File.Exists(famiglieDiScontoPath)
' Se il file esiste, aprilo; altrimenti creane uno nuovo
If System.IO.File.Exists(famiglieDiScontoPath) Then
' Apri il file esistente SENZA mostare finestre di conferma
xlNewWorkbook = xlNewApp.Workbooks.Open(famiglieDiScontoPath, [ReadOnly]:=False, [Editable]:=True)
Else
' Crea un nuovo file se non esiste
xlNewWorkbook = xlNewApp.Workbooks.Add()
End If
' Ottieni il foglio "Famiglie Di Sconto"
Try
xlNewWorksheet = xlNewWorkbook.Sheets("Famiglie Di Sconto")
Catch ex As Exception
' Se il foglio non esiste, crealo
xlNewWorksheet = xlNewWorkbook.Sheets(1)
xlNewWorksheet.Name = "Famiglie Di Sconto"
End Try
' **1. Recupera combinazioni esistenti nel file di destinazione**
Dim existingEntries As New HashSet(Of String)
Dim lastExistingRow As Integer = xlNewWorksheet.Cells(xlNewWorksheet.Rows.Count, 1).End(XlDirection.xlUp).Row
If lastExistingRow < 2 Then lastExistingRow = 1 ' Assicura che parta da riga 2 in poi
For rowIndex As Integer = 2 To lastExistingRow
Dim existingCodiceUnivoco As String = xlNewWorksheet.Cells(rowIndex, 1).Value
Dim existingSconto As String = xlNewWorksheet.Cells(rowIndex, 2).Value
Dim existingPrezzo As String = xlNewWorksheet.Cells(rowIndex, 3).Value
If Not String.IsNullOrEmpty(existingCodiceUnivoco) And Not String.IsNullOrEmpty(existingSconto) Then
existingEntries.Add(existingCodiceUnivoco & "_" & existingSconto & "_" & existingPrezzo)
End If
Next
' **2. Trova la prima riga disponibile per i nuovi dati**
Dim nextRow As Integer = lastExistingRow + 1
' **3. Creiamo un HashSet per nuovi dati da copiare**
Dim uniqueEntries As New HashSet(Of String)
' Trova gli indici delle colonne nel file originale
Dim codiceUnivocoIndex As Integer = columnHeaders.IndexOf("Codice Univoco Azienda") + 1
Dim scontoIndex As Integer = columnHeaders.IndexOf("Sconto") + 1
Dim prezzoIndex As Integer = columnHeaders.IndexOf("Prezzo") + 1
' **4. Scansiona il file di origine e copia solo nuove combinazioni**
For rowIndex As Integer = headerRow + 1 To xlWorksheet.UsedRange.Rows.Count
Dim codiceUnivocoValue As String = xlWorksheet.Cells(rowIndex, codiceUnivocoIndex).Value
Dim scontoValue As String = xlWorksheet.Cells(rowIndex, scontoIndex).Value
Dim prezzoValue As String = xlWorksheet.Cells(rowIndex, prezzoIndex).Value
Dim entryKey As String = codiceUnivocoValue & "_" & scontoValue & "_" & prezzoValue
' Se la combinazione non è già presente nel file di destinazione, aggiungila
If Not existingEntries.Contains(entryKey) And Not uniqueEntries.Contains(entryKey) Then
uniqueEntries.Add(entryKey)
xlNewWorksheet.Cells(nextRow, 1).Value = codiceUnivocoValue ' "Codice Univoco Azienda" in colonna A
xlNewWorksheet.Cells(nextRow, 2).Value = scontoValue ' "Sconto" in colonna B
xlNewWorksheet.Cells(nextRow, 3).Value = prezzoValue ' "Prezzo" in colonna C
nextRow += 1
End If
Next
' **5. Salva e chiudi il file di destinazione**
xlNewWorkbook.Save()
xlNewWorkbook.Close(SaveChanges:=True)
xlNewApp.Quit()
' **Rilascia le risorse**
ReleaseObject(xlNewWorksheet)
ReleaseObject(xlNewWorkbook)
ReleaseObject(xlNewApp)
Catch ex As Exception
MessageBox.Show($"Errore durante l'esportazione: {ex.Message}", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Try
' Verifica che gli oggetti Excel siano inizializzati
If xlApp Is Nothing OrElse xlWorkbook Is Nothing OrElse xlWorksheet Is Nothing Then
MessageBox.Show("Non c'è un file Excel aperto. Apri un file prima di esportare.", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return
End If
' Verifica che un codice sia stato selezionato nella ComboBox
Dim selectedCodice As String = ComboBoxCodici.SelectedItem?.ToString()
If String.IsNullOrEmpty(selectedCodice) Then
MessageBox.Show("Seleziona un codice univoco dalla ComboBox prima di esportare.", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return
End If
' Esporta i dati in un nuovo file Excel
SaveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm"
If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
Dim exportFilePath = SaveFileDialog1.FileName
Dim newWorkbook = xlApp.Workbooks.Add()
Dim newWorksheet = CType(newWorkbook.Sheets(1), Worksheet)
' Calcola il numero totale di righe da elaborare
Dim totalRows = xlWorksheet.UsedRange.Rows.Count - headerRow
Dim currentRow = 0
ProgressBar1.Visible = True
ProgressBar1.Value = 0
' Cambia i nomi delle colonne secondo l'ordine standard e aggiungi titoli al nuovo file
For colIndex = 0 To ListBox1.Items.Count - 1
Dim currentHeader As String = ""
If colIndex < ListBox1.Items.Count Then
currentHeader = ListBox1.Items(colIndex).ToString()
End If
If Not String.IsNullOrEmpty(currentHeader) Then
newWorksheet.Cells(1, colIndex + 1).Value = currentHeader
End If
' Usa il nome della colonna standard se necessario
If colIndex < standardColumnOrder.Count AndAlso currentHeader <> standardColumnOrder(colIndex) Then
currentHeader = standardColumnOrder(colIndex)
End If
' Imposta il nome della colonna nel nuovo file
newWorksheet.Cells(1, colIndex + 1).Value = currentHeader
Next
' Copia i dati ordinati dalla ListBox al nuovo foglio Excel
For rowIndex = headerRow + 1 To xlWorksheet.UsedRange.Rows.Count
For colIndex = 1 To ListBox1.Items.Count
Dim columnName = ListBox1.Items(colIndex - 1).ToString()
Dim originalIndex = columnHeaders.IndexOf(columnName) + 1
' Copia il valore dalla colonna originale
Dim cellValue = If(originalIndex > 0, xlWorksheet.Cells(rowIndex, originalIndex).Value, "")
' Se la colonna è "Codice Univoco Azienda", usa il valore selezionato
If colIndex = 5 Then
cellValue = selectedCodice
End If
' Scrivi il valore nella nuova cella
newWorksheet.Cells(rowIndex - headerRow + 1, colIndex).Value = If(cellValue IsNot Nothing, cellValue, "")
Next
' Aggiorna la barra di caricamento
currentRow += 1
ProgressBar1.Value = CInt((currentRow / totalRows) * 100)
System.Windows.Forms.Application.DoEvents()
Next
' Salva il nuovo file
MessageBox.Show(exportFilePath)
newWorkbook.SaveAs(exportFilePath)
newWorkbook.Close()
' Carica i dati esportati nella GridView
LoadExportedDataIntoGridView(exportFilePath)
' Aggiorna lo stato dei pulsanti
isExported = True
BtnUploadToDatabase.Enabled = True
BtnExport.Enabled = False
ProgressBar1.Visible = False
MessageBox.Show("File esportato con successo.")
End If
Catch ex As Exception
MessageBox.Show($"Errore durante l'esportazione: {ex.Message}")
' Non chiudere gli oggetti Excel per permettere ulteriori tentativi
Finally
' Assicurati che la ProgressBar sia nascosta
ProgressBar1.Visible = False
End Try
End Sub
r/visualbasic • u/nicholas_chye • Mar 10 '25
i tried alot of things but i cant seem to find the problem of why my visual basic database connection is not working , please help me
r/visualbasic • u/morgana_dood • Mar 05 '25
So I’m struggling with this part of an assignment. I have to code a software and part of it is really tripping me up. So it’s asking me to code that when I press a button it changes color and a corresponding text box stays disabled. Then click it again and the button changes color again, then that corresponding text box is enabled. I’ve got the color changing part down I just can’t figure the enabling of the text box after the second click. I feel like it’s staring me right in the face but I can’t figure out. Help?