then you need to push the power button on your computer.
No that would be how my computer on not how to open the box to my computer :D
then you need to push the power button on your computer.
No that would be how my computer on not how to open the box to my computer :D
Shell "rundll32.exe shell32.dll,Control_RunDLL"
Are you referring to allowable colors? What's the point in having more? Why would it ever be necessary to have more? Note that you can do (code=syntax) to automatically syntax highlight your code.
code:
If this is True Then
End IF
code=vb:
If this is True Then
End IF
code=vb6:
If this is True Then
End IF
code=vb6.0:
If this is True Then
End IF
code=visual basic 6.0:
If this is True Then
End IF
As you can see the automatic code=syntax does not work correctly for vb as the words If Is True Then End If all should be in blue. Also is should be Is. Third, NOT all vb 6 or .Net code comes with line numbers as it is an option and for some it just clutters the display.
Only green and red? What about blue? Or perhaps using valid RGB(?,?,?)
See http://www.tek-tips.com for some examples...
Well that is an entirely different animal. Try adding an if statement to check for the existance of a valid recordset...
If rs.BOF = False AND rs.EOF = False AND rs.RowCount <> 0 Then
'we have a valid recordset with at least one record
End If
it is possible? if the user in the running time, click the close button or the X button that we can see in the top of the form and then if the user click the close or X button message box will appear "you cannot log out"? how can i do this? thanks. .
yes this is possible
Private Sub Form_Unload(Cancel As Integer)
Cancel = True 'set to any none zero number could be cancel=1
MsgBox "Running, cannot close form now!"
End Sub
You are missing the character ";" after your ReadOnly=0 as I can see it after each and every other named arguement but the readonly arg.
Okay, at first I thought this might be tough to do since it is a spawned application, but... It was easier than I thought. Add these variables at the top.
Dim C, I As Integer
and then after your readystate check add this
For Each C In .Document.links
I = I + 1
Next C
MsgBox I
Now, as you can see, "C" is a varient and "I" is used for counting the links. Also, I tried .Document.Links.Count but that is not supported so you have to enumerate through them to get the count.
Good Luck
http://www.x-rates.com/cgi-bin/cgicalc.cgi?value=1&base=EUR
Based the link how to count element in table of this page?note: is the table where are all currency values
tks.
in vba please
What technology are you using to view/download the document?
Do you think he is looking to avoid executing it, at all? I didn't even consider that's what he was asking. He said stop execution and I saw that exec() continued in an infinite loop, so I assumed he was looking for a way to halt execution at a point.
We'll see what he says, I guess.
You could be right, but he also stated that he did not want to alter the exec sub, which meant to me that it is called from someplace else and while I agree it does look like an infinant loop that only attempts to update a label with a value like a progress indicator, one would think that there is a way to exit the sub even if we don't see it from the example given. Which leads me to believe that we don't have the entire picture of what is going on.
Please read my post more carefully
If you don't want it executed, don't call it from the click event.
If the API instructions are above your head, check out the MMC (Multimedia control). Right click on your toolbox, select components, scroll down and select the Microsoft Multimedia Control 6.0 (SP3). Once it is on your form press F1 for help and read all about it.
Good Luck
There are a couple of ways to solve this but first question is...
does the other program create the file if it is not there?
If so, you could wait until you have exclusive access to the file and once you do you could do a couple of different things. First you could name the file a different name and allow the other program to create a new file and continue on with its operations while you leisurly open the other file, read in its contents, and then delete it.
If the other program does not create the file if it is not there then, once again wait until you can get exclusive access to the file, rename it, then rename a blank file to replace it while you take your time once again.
Now, if you can never get exclusive access to the file, then you could keep track of how many bytes you have read in and each time you access the file (binary random access), you could jump to that position or you could remember how many lines you have read in and before you start comparing you could read in that many lines + or - 1 or exact, however you want. Then start comparing and adding.
Good Luck
i see the ; character after each setting but the readonly=0. Should it not be readonly=0; ?
Use the Name operator
Name OldFileName As NewFileName
Thanks vb5prgrmr
But still my problem is not solved. I have DtPicker control in my form and i want the result according to it's value. I try you code giving date as dtpicker value but still problem is same.Private Sub Command1_Click()
Dim Remainder As Integer, Week As Integer
Remainder = Day(DTPicker1.Value) Mod 7
Week = Day(DTPicker1.Value) \ 7
If Remainder > 0 Then Week = Week + 1
MsgBox Week
End Sub
Your second Code :Private Sub Command2_Click()
Dim Remainder As Integer, MyWeek As Integer
Dim DayStart As Integer, MyDateString As String
MyDateString = DTPicker1.Value
DayStart = Weekday(Month(MyDateString) & "/1/" & Year(MyDateString))
MyDateString = DateAdd("d", DayStart, MyDateString)
Remainder = Day(MyDateString) Mod 7
MyWeek = Day(MyDateString) \ 7
If Remainder > 0 Then MyWeek = MyWeek + 1
MsgBox MyWeekEnd Sub
But both these code does not give always correct result.
Yep, the second has an error because of a quick cut and paste. Just remove the "If Remainder" line
First off, your code does not take into account if the month starts on a saturday or any other day other than what is considered to be the first day of the week. Second, in a month with 31 days there could actually be 6 weeks in the month depending upon what day the month started and this would depend upon if you are using a fixed week or a dynamic week.
Fixed week means you consider the week to be set from sun to sat or mon to sun while a dynamic week means that the week starts on the first day of the month.
For a dynamic week it is quit simple
Dim Remainder As Integer, Week As Integer
Remainder = Day("5/15/2009") Mod 7
Week = Day("5/15/2009") \ 7
If Remainder > 0 Then Week = Week + 1
MsgBox Week
However, if you are using fixed weeks then...
Dim Remainder As Integer, MyWeek As Integer
Dim DayStart As Integer, MyDateString As String
MyDateString = "5/13/2009"
DayStart = Weekday(Month(MyDateString) & "/1/" & Year(MyDateString))
MyDateString = DateAdd("d", DayStart, MyDateString)
Remainder = Day(MyDateString) Mod 7
MyWeek = Day(MyDateString) \ 7
If Remainder > 0 Then MyWeek = MyWeek + 1
MsgBox MyWeek
Good Luck
Good day.!
What a frustration drives me just this day.! Last night we got power lost. Just this day when i open my vb project, ive got an error message says that project1 cannot be loaded. When i try to open one form on that project it also returned, form1 cannot be loaded. Im stuck with this until now.I dont have any back up yet. How can i recover my project or just the form.! I try to open it in notepad but i ve just see unreadable information. Please help
Thank you
Copy offending file to another directory.
Open with notepad and do a save as.
If prompted for saving unicode characters, don't. Save as text only.
Dbl click on new file in explorer and VB should open up and start a new project for you. If form is still unreadable by VB or in notepad you may be out of luck, but...
If you find that it is now ledgable but seems to be missing carrage returns, well then... I hope there is not a lot of controls and code located in that file.
(Meaning you will have to add them manually)
Good Luck