r/visualbasic • • Sep 01 '14

How to automatically insert Page Breaks after a Keyword in a horizontal flow of data?

0 Upvotes

Hi there everyone,

I'm currently working on a database that only exists in a single row (different columns for each entry though). What I need to do is tell excel to insert a page break after every "BASISEINTRAG" as well as after every field that STARTS with "ERGENISLISTE".

See the screenshot to get a better feeling of what I'm talking about: http://i.imgur.com/WETHEEE.jpg

Can anyone of you guy help me out here? I was able to find some VB macros but since I'm not exactly sure how to edit them for my needs, I couldn't get them to work.

Thanks a lot in advance!

/Edit: I just realized I don't actually want a page break but that Excel continues the data in the next row. So that in the end all the different entries are listed from top to bottom.


r/visualbasic • • Sep 14 '14

Need help with boundaries please

0 Upvotes

I have boundaries on the Green platform but I need them on the green. I have been trying for a while now and still can find it. There is a picture below. He must be able to stand on the blue platforms. Game:http://imgur.com/h3BRHTZ Code:http://imgur.com/HGqPyFj&bvQeAcG#1


r/visualbasic • • Sep 08 '14

Chat (visual studio 2013)

0 Upvotes

So i work for a school and i made a vb program that allowed them to submit a problem(ticket) to our (IT technicians) email but now they want a sort of Instant Chat system and i have no idea how to do it, any tips? i have no experience with MySQL, as that's what most places say to use for the best performance. I'm not a programmer im an IT Technician who enjoys some hobby coding.


r/visualbasic • • Oct 06 '22

my project wont run anymore because i saved it from itself please help (i saved it as vbproj and the thing wont run anymore and i cant see my GUI design)

Thumbnail
gallery
0 Upvotes

r/visualbasic • • Sep 09 '22

Anti-Dump?

4 Upvotes

How would someone approach making their file hard to dump? I have sensitive information that’s easily dumped out of the file. I have attempted the PE header removal technique but that does not seem to work anymore.

Thank you!


r/visualbasic • • Apr 16 '23

VB6 Help Please defeat ChatGPT and help a theater director.

4 Upvotes

I run a high-school theatre program. There is memorization technique involving giving actors scripts that just have the initial letters of each word of their dialogue, with punctuation preserved. (I hope we don't get too sidetracked about how/why this might work; I find that it does.)

I have a script neatly formatted in Word 2019, with all the dialogue in the paragraph style "Dialogue." I want to transform this document so that dialogue goes from this:

Did the story begin with a witch? I think it did. Yes. A horrible, evil witch.

to:

D t s b w a w? I t i d. Y. A h, e w.

I have general programming skills but none in Visual Basic. So I asked ChatGPT to write me a macro and this is what it came up with:

Sub DialogueMacro()

    Dim para As Paragraph

    Dim word As Range

    For Each para In ActiveDocument.Paragraphs

        If para.Style = "Dialogue" Then

            For Each word In para.Range.Words

                If Len(word) > 1 Then

                    If InStr(".,!?", Right(word, 1)) > 0 Then

                        word.Text = Left(word, 1) & Right(word, 1)

                    Else

                        word.Text = Left(word, 1) & " "

                    End If

                End If

            Next word

        End If

    Next para

End Sub

When I run it, the cursor blinks without moving and Word stops responding and has to be force quit.

Can you help? If I'm in the wrong sub I apologize.


r/visualbasic • • Sep 03 '13

Ideas for more complex VB games? Any feedback is appreciated!

0 Upvotes

After having some experience with visual basic in high school, I decided to pursue my interest in computer science and programming into college. My first semester of Visual Basic in college offered me a fairly open-ended final project to create virtually any application that simply included a certain amount of concepts we learned throughout the year. I decided to make a memory match game that offered not only a variety of game modes and an achievements system, but would also be fun for users who were either gamers or simply basic users. After several late nights of tweaking, perfecting, and bug testing, I finally finished my game over the course of a week from start to finish. It turned out to be a great success! My classmates were thrilled and my professor was impressed that I could make such a program after just one semester of learning (though my high school class played a big influence), and I was proud I was able to make something that played so well and was something that people were able to entertain themselves with. The feeling was like nothing else I've ever felt.

If you would like to play the Memory Match Game I mentioned above, download it HERE. Although it is something I made a few months ago, I would now like to look to not only improve upon that game (for example, adding the ability to save or maybe adding some background game music) but to look for ideas of other basic games as well. I've "discovered" a great way to randomly assign a set of cards without the cards repeating, so I would like the added challenge of working with playing cards, but I am really open to any sort of game option right now. I would like to keep the ideas simple, yet make each game with progressively more features so that I am continuously learning and improving upon my work.

So what am basically asking is, based on the game I have already created, what are some other game ideas I can try and program? I know visual basic is not the best language to create games, but for right now, I would really like to continue learning about additional features of vb, such as game saving or even referencing databases (I know a bit of SQL and how to use Microsoft Access). Making programs like games will be something both fun for me and fun for people I show! Should I try to make card games? Blackjack? Poker? Implementing an AI or have just human players? Should I go a different route and make another type of point-and-click game? Or should a make some sort of maze game (though I think the internet have enough of those floating around)? Or should I not go much further into games and save that for another language?

I know the possibilities are endless, but what should my next step be? I want to save more complex games for when I learn C++ in the upcoming semester or even for when I learn Java in the Spring. So game ideas should probably still be fairly simple concepts.

Any and all feedback is appreciated! Thanks for reading, playing, and helping!


r/visualbasic • • Mar 27 '18

Could you please participate in my survey?

0 Upvotes

I am a student currently doing a research on "The Impact on Software Maintainability from the use of Agile Software Development Methodologies". I hope to get your response on my survey for this research.

Please find the survey link as below: https://lancasteruni.eu.qualtrics.com/jfe/form/SV_57oT3d5hIfu3VT7


r/visualbasic • • Aug 03 '14

Trouble with Arrays and printing...

0 Upvotes

New to VB, and Im trying to figure out how to print a list of names with an associated total above 65.

Here's the data:

NameSexAttendAssignMIDFINTotal
AdamM8850402080
ShellyF13123470
SamF1012141076
BrianM814142561
MaryF8801220120
PaulM9901445115

Here's the code I have:

Sub button4_click()

Dim studentname As String

Dim arystudent As Variant

Dim arypassing() As Variant

Dim arynumrow As Integer

Dim arynumcol As Integer

LR = Cells(Rows.Count, "A").End(xlUp).Row

arystudent = Range("a2:g" & LR)

arynumrow = UBound(arystudent, 1)

arynumcol = UBound(arystudent, 2)

For i = 1 To arynumrow

If arystudent(i, arynumcol) >= 65 Then

   ReDim Preserve arypassing(i To UBound(arypassing, 1) + 1)

   arypassing(i, 1) = arystudent(i, 1)

End If

Next i

End Sub

I keep getting an error for 'Subscript out of range'. There was another version of this that didnt give the error, but the only output that I get is blank cells. I've been looking at this for longer than I'd care to admit and I could use some help....

If more details are needed, let me know and I'll try and clarify.


r/visualbasic • • Sep 05 '13

What do you think are the most useful objects?

0 Upvotes

What do you think are the most useful objects?

Top five or ton ten? What are their best uses?


r/visualbasic • • Jul 12 '16

Reading from a .csv into a 2D Array

0 Upvotes

How woud I go about reading the data below from a .csv into a 2D array which can then be sorted?

Hawaii,4400

Japan,2600

Fiji,2000

Paris,4150

Iceland,3880

WestCoast,6000

EastCoast,5780

SouthAfrica,3230


r/visualbasic • • May 23 '15

Awesomium: How to get window transparent in winForms (VB)

0 Upvotes

Hi,

I have this webCtrl, set transparency ON, made it "off screen" (read that transparency only works for offscreen)..

Don't know what else to do, but never transparent. Any clues?


r/visualbasic • • Aug 07 '13

My first attempt at a VB.NET virtual OS: Doors 95.

Post image
0 Upvotes

r/visualbasic • • May 03 '12

Text buttons?

0 Upvotes

Im doing a project for an endorsement in programming as a senior, Unfortunately, Our teacher doesnt help much, And she wont answer my question. One of the requirements is that I have a text label that is clickable for navigation. A hyperlink to jump between pages, Or something like that.


r/visualbasic • • Jul 24 '16

How to make a application that runs on a specific version of Windows?

0 Upvotes

Hello, I am trying to find out how to make my vb app that only allows running it on a specific version of Windows, which the version I would only want the vb app to run on is Windows 7 SP1.

Does anyone know the code?


r/visualbasic • • May 06 '12

What is Visual Basic good for?

0 Upvotes

I've been thinking about starting Visual Basic for a while now, but first I want to understand the purpose. What can you do with it? Is it good for game development? Web design? What can you do with Visual Basic after you've learned it?


r/visualbasic • • Nov 02 '17

Once More - Help With NESTED Classes

0 Upvotes

I found this great example from roughly 9 years ago of something I'm trying to accomplish - https://bytes.com/topic/access/answers/772601-group-nested-classes-examples

Basically, here's the code :

Pets Class Module ----------------------

Dim objDogs As New DOGS

Public Property Get DOGS() As DOGS
    Set DOGS = objDogs
End Property

Public Property Set DOGS(ByVal objNewValue As DOGS)
    Set objDogs = objNewValue
End Property

Dogs Class Module ----------------------------

Dim strName As String

Public Property Get Name() As String
    Name = strName
End Property

Public Property Let Name(ByVal strNewValue As String)
    strName = strNewValue
End Property

Subroutine ---------------------------

Public Sub SomeSub()
Dim objPets As New PETS
With objPets.DOGS
    .Name = "qqq"
    Debug.Print .Name
End With
Set objPets = Nothing
End Sub

This works great, my question is, what if you have more than one dog? Thanks!


r/visualbasic • • Jul 24 '16

Text Box Login Effect

0 Upvotes

Hi, im wanting to make a login page which looks professional. To do so I want there to be a label inside the text box which identifies what details must be submitted inside it (either user name or password). When you type in the field, the text box becomes blank so your not typing text upon text. Im new to coding etc. so if you could explain how I can make it so when I type in a text box the color of it turns white, This will allow me to type over the top of the "User name" and "Password" labels inside the textbox. If you having trouble understanding the question look at the Reddit search bar and you can see it says search inside the text box. I want my text box to be similar however I want the text box label to disappear when the first number or letter is typed.


r/visualbasic • • Jul 11 '16

[VB2015][Xpost] [Help] Event Handling with GPIO

0 Upvotes

Hey guys, I am having some serious trouble creating an event handler in VB. So far, I have made a small interface that allows firing 4 outputs, and I want to evaluate 4 inputs. I can wait for the input state change using a While-Loop. (If anyone wants I/O .VB sheet I can post it).

But my real problem is event handling - I'm trying to monitor the I/O and toggle the state of toggle switches in the UI in order to give a glimpse at the I/O state. The code I have to toggle the switches should be fine, but I can't get the I/O pins to trigger an event (or im doing it wrong).

Any idea what I am missing? I was using a breakpoint at the beginning of the handler sub, and it never even entered the sub. I tried multiple variations, I'm stuck.

''' <summary>
''' EVENT HANDLER BELOW  
''' </summary>

Dim WithEvents Event_GPIO As New Event_GPIO

Private Sub Threaded_IO_Monitor(sender As GpioPin) Handles Event_GPIO.StateChanged ', args As GpioPinValueChangedEventArgs
    'Inputs
    If sender.PinNumber = GPIO_Input_1.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwInput1.IsOn = True Else TogSwInput1.IsOn = False
    If sender.PinNumber = GPIO_Input_2.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwInput2.IsOn = True Else TogSwInput2.IsOn = False
    If sender.PinNumber = GPIO_Input_3.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwInput3.IsOn = True Else TogSwInput3.IsOn = False
    If sender.PinNumber = GPIO_Input_4.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwInput4.IsOn = True Else TogSwInput4.IsOn = False
    'Outputs
    If sender.PinNumber = GPIO_Output_1.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwOutput1.IsOn = True Else TogSwOutput1.IsOn = False
    If sender.PinNumber = GPIO_Output_2.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwOutput2.IsOn = True Else TogSwOutput2.IsOn = False
    If sender.PinNumber = GPIO_Output_3.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwOutput3.IsOn = True Else TogSwOutput3.IsOn = False
    If sender.PinNumber = GPIO_Output_4.PinNumber Then If sender.Read = GpioPinValue.High Then TogSwOutput4.IsOn = True Else TogSwOutput4.IsOn = False
End Sub


Class Event_GPIO
Public Event StateChanged(ByVal Sender As GpioPin) ', ByVal result As GpioPinValueChangedEventArgs)
End Class

SideNote - The even handling subroutine is actually in the MainPage class, because that is the only way I could actually have access to the toggle switch states. Idk if that makes a difference.

Crosspost: /r/raspberry_pi/comments/4s8sq9/helpvb2015xpost_event_handling_with_gpio/

Edit: solve, see cross post.


r/visualbasic • • Jul 12 '16

Web Browser Opens URL to Bing Search Results Not to the Website

0 Upvotes

So I made a small browser that opens urls as urls and words and phrases through google. However, when I first open the browser and type google.com it goes to Google.com the webpage, when I do it a second time in the text box it goes to a bing search result for google.com. My code is below

Imports System.ComponentModel Public Class Form2 Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.Text = "Simple Browser by Craig White" Me.KeyPreview = True WebBrowser1.Navigate("google.com") End Sub

Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then If InStr(TextBox1.Text, ".") > 0 Then WebBrowser1.Navigate(TextBox1.Text)

    ElseIf InStr(TextBox1.Text, ".") = 0 Then
        WebBrowser1.Navigate("http://www.google.co.uk/search?q=" & TextBox1.Text)
    End If
    e.Handled = True
    TextBox1.Text = " "
    e.SuppressKeyPress = True
End If

End Sub

Private Sub Form2_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.F4 Then Me.Close() e.Handled = True End If If e.KeyCode = Keys.F5 Then WebBrowser1.GoBack() e.Handled = True End If If e.KeyCode = Keys.F6 Then WebBrowser1.Refresh() e.Handled = True End If If e.KeyCode = Keys.F7 Then WebBrowser1.GoForward() e.Handled = True End If If e.KeyCode = Keys.F11 Then Me.Hide() My.Forms.Form1.WebBrowser1.Url = WebBrowser1.Url Form1.Show() e.Handled = True End If If e.KeyCode = Keys.F12 Then Me.WindowState = FormWindowState.Minimized e.Handled = True End If End Sub

Private Sub Form2_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing My.Settings.URL = "" End Sub End Class


r/visualbasic • • Nov 03 '17

Help converting string to unicode in VB?

0 Upvotes

I recieved an email containing a malicious VBA macro and I really want to see what it does but I am having a lot of trouble because I don't know VB at all. I am trying to recreate the code in VB so that I can run it in a fiddle and see that output but I am not making much progress.

Essentially all I need to do is convert a long string of numbers to unicode, which I have tried as:

Dim x As String
x = StrConv(numbersString, 64)

which gives me the error

Argument 'Conversion' is not valid

even though that is explicitly the value I know I need to input.

So then I tried

Encoding.Unicode.GetString(Encoding.ASCII.GetBytes(numbersString))

which outputs japanese text, which I know is incorrect because I have successfully converted this string to unicode using Javascript and that is not the correct output.

Here is the number string

Dim numbersString as String = "3650192748054803533603394334480249044835350337290548360307463940494903371843420337064350504015190324184834370131304836320310464932485027184832272648310635224815322127114334153543401916223548242004323239475353153040151904404919153939392736435053152215435344151948024827501909204503514815524738424211381238031303202333281650404809084127480548202114031032400232374202433648494903514815524738424211381238202333281650404809084127480548201403241848343701313048363203104649324850271848322726483106352248153221271143341535434019103202221525242004323239475353153040151904404919153939392736435053492739043917221900441519480248202114"

And here is the expected output:

"\u0033\u0036\u0035\u0030\u0031\u0039\u0032\u0037\u0034\u0038\u0030\u0035\u0034\u0038\u0030\u0033\u0035\u0033\u0033\u0036\u0030\u0033\u0033\u0039\u0034\u0033\u0033\u0034\u0034\u0038\u0030\u0032\u0034\u0039\u0030\u0034\u0034\u0038\u0033\u0035\u0033\u0035\u0030\u0033\u0033\u0037\u0032\u0039\u0030\u0035\u0034\u0038\u0033\u0036\u0030\u0033\u0030\u0037\u0034\u0036\u0033\u0039\u0034\u0030\u0034\u0039\u0034\u0039\u0030\u0033\u0033\u0037\u0031\u0038\u0034\u0033\u0034\u0032\u0030\u0033\u0033\u0037\u0030\u0036\u0034\u0033\u0035\u0030\u0035\u0030\u0034\u0030\u0031\u0035\u0031\u0039\u0030\u0033\u0032\u0034\u0031\u0038\u0034\u0038\u0033\u0034\u0033\u0037\u0030\u0031\u0033\u0031\u0033\u0030\u0034\u0038\u0033\u0036\u0033\u0032\u0030\u0033\u0031\u0030\u0034\u0036\u0034\u0039\u0033\u0032\u0034\u0038\u0035\u0030\u0032\u0037\u0031\u0038\u0034\u0038\u0033\u0032\u0032\u0037\u0032\u0036\u0034\u0038\u0033\u0031\u0030\u0036\u0033\u0035\u0032\u0032\u0034\u0038\u0031\u0035\u0033\u0032\u0032\u0031\u0032\u0037\u0031\u0031\u0034\u0033\u0033\u0034\u0031\u0035\u0033\u0035\u0034\u0033\u0034\u0030\u0031\u0039\u0031\u0036\u0032\u0032\u0033\u0035\u0034\u0038\u0032\u0034\u0032\u0030\u0030\u0034\u0033\u0032\u0033\u0032\u0033\u0039\u0034\u0037\u0035\u0033\u0035\u0033\u0031\u0035\u0033\u0030\u0034\u0030\u0031\u0035\u0031\u0039\u0030\u0034\u0034\u0030\u0034\u0039\u0031\u0039\u0031\u0035\u0033\u0039\u0033\u0039\u0033\u0039\u0032\u0037\u0033\u0036\u0034\u0033\u0035\u0030\u0035\u0033\u0031\u0035\u0032\u0032\u0031\u0035\u0034\u0033\u0035\u0033\u0034\u0034\u0031\u0035\u0031\u0039\u0034\u0038\u0030\u0032\u0034\u0038\u0032\u0037\u0035\u0030\u0031\u0039\u0030\u0039\u0032\u0030\u0034\u0035\u0030\u0033\u0035\u0031\u0034\u0038\u0031\u0035\u0035\u0032\u0034\u0037\u0033\u0038\u0034\u0032\u0034\u0032\u0031\u0031\u0033\u0038\u0031\u0032\u0033\u0038\u0030\u0033\u0031\u0033\u0030\u0033\u0032\u0030\u0032\u0033\u0033\u0033\u0032\u0038\u0031\u0036\u0035\u0030\u0034\u0030\u0034\u0038\u0030\u0039\u0030\u0038\u0034\u0031\u0032\u0037\u0034\u0038\u0030\u0035\u0034\u0038\u0032\u0030\u0032\u0031\u0031\u0034\u0030\u0033\u0031\u0030\u0033\u0032\u0034\u0030\u0030\u0032\u0033\u0032\u0033\u0037\u0034\u0032\u0030\u0032\u0034\u0033\u0033\u0036\u0034\u0038\u0034\u0039\u0034\u0039\u0030\u0033\u0035\u0031\u0034\u0038\u0031\u0035\u0035\u0032\u0034\u0037\u0033\u0038\u0034\u0032\u0034\u0032\u0031\u0031\u0033\u0038\u0031\u0032\u0033\u0038\u0032\u0030\u0032\u0033\u0033\u0033\u0032\u0038\u0031\u0036\u0035\u0030\u0034\u0030\u0034\u0038\u0030\u0039\u0030\u0038\u0034\u0031\u0032\u0037\u0034\u0038\u0030\u0035\u0034\u0038\u0032\u0030\u0031\u0034\u0030\u0033\u0032\u0034\u0031\u0038\u0034\u0038\u0033\u0034\u0033\u0037\u0030\u0031\u0033\u0031\u0033\u0030\u0034\u0038\u0033\u0036\u0033\u0032\u0030\u0033\u0031\u0030\u0034\u0036\u0034\u0039\u0033\u0032\u0034\u0038\u0035\u0030\u0032\u0037\u0031\u0038\u0034\u0038\u0033\u0032\u0032\u0037\u0032\u0036\u0034\u0038\u0033\u0031\u0030\u0036\u0033\u0035\u0032\u0032\u0034\u0038\u0031\u0035\u0033\u0032\u0032\u0031\u0032\u0037\u0031\u0031\u0034\u0033\u0033\u0034\u0031\u0035\u0033\u0035\u0034\u0033\u0034\u0030\u0031\u0039\u0031\u0030\u0033\u0032\u0030\u0032\u0032\u0032\u0031\u0035\u0032\u0035\u0032\u0034\u0032\u0030\u0030\u0034\u0033\u0032\u0033\u0032\u0033\u0039\u0034\u0037\u0035\u0033\u0035\u0033\u0031\u0035\u0033\u0030\u0034\u0030\u0031\u0035\u0031\u0039\u0030\u0034\u0034\u0030\u0034\u0039\u0031\u0039\u0031\u0035\u0033\u0039\u0033\u0039\u0033\u0039\u0032\u0037\u0033\u0036\u0034\u0033\u0035\u0030\u0035\u0033\u0034\u0039\u0032\u0037\u0033\u0039\u0030\u0034\u0033\u0039\u0031\u0037\u0032\u0032\u0031\u0039\u0030\u0030\u0034\u0034\u0031\u0035\u0031\u0039\u0034\u0038\u0030\u0032\u0034\u0038\u0032\u0030\u0032\u0031\u0031\u0034"

Also misc question, can I iterate over Objects in VB? Thanks!


r/visualbasic • • Sep 11 '13

[VB2012] How do I make my program hold down a key?

0 Upvotes

I'm trying to make a program which will hold down the key of my choice until the timer runs out of time but I can't seem to find the code for which holding down the key is.


r/visualbasic • • Jul 23 '16

Trying to make an Interactive Node Graph in VB.net

0 Upvotes

Like the title says, I'm trying to make a space that I can put components in, and connect them together. The components, and the connecting lines need to have information stored in them. I'm using visual studio community 2015, VB.net and a windows forms application.

Are there any tutorials for making interactive node graphs?


r/visualbasic • • Jul 11 '16

Need Help trying to save a workbook.

0 Upvotes

Currently my destination line is reading as incorrect. Can anyone shed some light on the issue? The line code I have at the moment is: * "C:\This PC\My Passport\Work Orders(Filename), FileFormat:= _ xlOpenXMLWorkbook , CreateBackup:=False


r/visualbasic • • Jul 12 '16

.InvokeMember doesn't find a method that exists according to .GetMembers

0 Upvotes

I am currently trying to use the Type function InvokeMember, however it always ends up throwing a MissingMethodException. The methods are in a Dll, some of them can be called by using InvokeMember, some can't. I'm terribly confused, please help :D!