The quick response is "What does that mean?". It makes absolutely no sense in English. I realise that English may not be your first language, but please explain what you want clearly or nobody will be able to help you.
I'm an optoholic - my glass is always half full of vodka.
This creates an email for each user and lists all their roles. I have been racking my brain trying to add another loop (possibly For Each?) that creates an email for all users of a given supervisor (column 7). For example, if a super has 3 employees, it creates 3 emails, I want it to create 1. It should loop through all supervisors sending them an email that includes all their workers.
I left the email piece off, below code works in Excel but generates an email for every user (column 3).
Anyone have any ideas? Please and thank you.
Dim l AsLongWith Sheet1
For l = 2To .Cells(Rows.Count, 1).End(xlUp).Row
If sUser = ""Then
sGreeting = .Cells(l, 1).Value
sEmail = .Cells(l, 2).Value
sCC = .Cells(l, 9).Value
sUser = .Cells(l, 3).Value
sName = .Cells(l, 4).Value
sDescription = .Cells(l, 5).Value
sRole = .Cells(l, 6).Value
sRole = sRole & ", " & .Cells(l, 6).Value
EndIfIf .Cells(l + 1, 3) <> sUser ThenCall SendEmail
sUser = ""EndIfNext l
I can't post worksheet so I explain in simplest terms
column A + B for email piece
column C = username (USER)
column D = name of user
column E = description (for email)
column F = role (user's role or roles)
column G = supervisor (of user)
I have code that loops through users and generates emails perfectly BUT let's say the supervisor has 20 employees; they would receive 20 emails in this scenario. I would like for them to receive 1 single email listing ALL of their users. This is what I mean by looping through the supervisor - getting their user data including roles.
I am sorry bu that means nothing to me, as I have no idea what the structure of your data is. However, the issue is the same as most problems of this type. You must run through the data as many times as necessary to build the groups which have the common item (e.g supervisor, role etc) that you are interested in. The first thing to do is write down all the common criteria, and then decide on how to build the groups using those rules.
I have a vb.net program.
In my program I want to use dates in the format "dd/MM/yyyy".
But when the windows date format is different I get errors.
For example if my program is executed in a Pc where the date is in the format : mm/dd/yyyy I get errors for example when day is more than 12 :
Dim dt As DateTime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")
I get error :
Conversion fromstring"20/09/2016 21:21:47" to type 'Date'is not valid.
What can I do to make my program work whatever the windows date format is configured.
That error does not happen where the date is formatted as a string. It happens when exactly the opposite happens: when the string is parsed to return a DateTime. At those positions, you must use DateTime.Parse("dd/MM/yyyy HH:mm:ss")
This is why all VB.NET programs should be compiled with Option Strict On.
You're taking a DateTime, converting to a String, and then assigning that String to a DateTime value.
Without Option Strict, VB is attempting to convert that String back to a DateTime. But it has to make some assumptions, one of which is that the String represents a date formatted using the current culture settings - in this case, US-format dates.
If you turn on Option Strict, you will get a compiler error telling you that you cannot store a String in a DateTime variable.
You could use DateTime.Parse or DateTime.TryParse to try to convert the String back into a DateTime.
But it would be much simpler to just not convert the DateTime to a String in the first place!
Dim dt As DateTime = DateTime.Now 'NB: No "ToString" call here!
Remember, a DateTime value does not have a "format" stored with it. It is simply the number of ticks since midnight on 1st January 0001. You only use a format when you are displaying the value to the user, or parsing a user-supplied string back into a DateTime.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
First off, I'm sorry if this is in the wrong section .I have this project that needed to receive data from PLC. The PLC comes from Keyence. Right now, I'm having hard time on how can I create it. Anyhelp will do. Thank you!
What sort of help are you looking for? Have you studied the documentation of the PLC device (whatever that is) to see whether you are accessing it correctly? Have you written any VB.NET code yet, and if so where is the problem?
Hmmm... where to start?
A PLC is a Programmable Logic Controller - basically an industrial computer.
So, how does the PLC make the data available - a direct connection or a networked connection?
Does the manufacturer have any code samples of how to connect to their device and get data from it?
We are generally willing to help, but your question is very wide open...
It's been a long time since VB6 has mystified me in its behaviour!
I have a function that solves Kakuro puzzles. It uses a 2D and a 3D array (both Integer) as its main data structures and employs a conventional DFS approach.
Naturally I compile to EXE with all run-time checks disabled for maximum grunt.
Recently I accidentally turned off these optimizations (I was in the wrong project window). But when I restored them and rebuilt the EXE I found to my horror that my solver has lost its mojo.
Every benchmark test I have reports exactly the same results (including, importantly, the number of DFS recursions) BUT all of them run 3 times slower than before. Nothing else has changed that I can think of.
Yeah, it's DEAD, for about 15 years now. Pointing at some crybabies demanding MS update it or open source it doesn't make it any more live. That just proves the point even more.
Yes, I used to use VB6 way back in the day but that changed the moment I got my hands on pre-release .NET 1.0 and had to use Notepad to write code and the command line compilers to build it. Even in that primitive environment I saw what was coming and it was a lot better than VB6. I abandoned VB6 completely the day I got my hands on Visual Studio .NET.
The VS6 IDE is barely supported on Win7 and isn't supported at all on Vista and above, so the "only runs on Win32 platforms" doesn't exactly tell anyone what they need to know. Yes, people have gotten it to work on every version of Windows XP and higher, but only buy jumping through flaming hoops to do it.
As Dave said the article you referenced does not indicate anything but that the demise of VB6 is permanent.
As it has been almost 15 years since I was using it I would have no idea that it could run on W7. I consider leaving VB6 for VB.net and then c# one of my better tool decisions, Silverlight still pisses me off though
Never underestimate the power of human stupidity
Hi all, I have e little problem that I hope someone can help me to solve it.
I have a Form in which there is a panel where I draw a graphical diagram using instruction paint, drawline.
The graphical is correctly drawn, but if I Minimize the Form and after I re-Maximize the Form, all contents of Form is maintened but the graphical in the Panel is lost.
What can/must I do to avoid this problem?
I am developing in VB of VS 2008.
No, he means put all of your painting code in a method that is called by the OnPaint event of the Panel. When Windows tells your app to repaint itself, your painting code should do everything it needs to draw everything on the Panel. You'd be surprised how often your painting code is going to be called.
How would you suppose that we can answer that? How could complete strangers on the internet know if something is possible for you to do or not? Sure, if you apply yourself, learn programming, and study, study, study you can probably do just about anything. But for us to tell you that you can sit down and bang this out in the next month? No, we can't tell you any such thing because we don't know you, your skill set or why on earth you would want to use an outdated ancient dead programming language like VB6 to begin with.
Last Visit: 31-Dec-99 18:00 Last Update: 27-Oct-16 0:25