|
Yes. And I solved it out as I mentioned in my previous reply.
|
|
|
|
|
Sub FilterWorkbook()
Sheets("SAT Assignments").Visible = True
Sheets("SAT Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("SAT Assignments").Visible = False
Sheets("SAT OSS Vac Log").Visible = True
Sheets("SAT OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("SAT OSS Vac Log").Visible = False
Sheets("SUN Assignments").Visible = True
Sheets("SUN Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("SUN Assignments").Visible = False
Sheets("SUN OSS Vac Log").Visible = True
Sheets("SUN OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("SUN OSS Vac Log").Visible = False
Sheets("MON Assignments").Visible = True
Sheets("MON Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("MON Assignments").Visible = False
Sheets("MON DBCS Vac Log").Visible = True
Sheets("MON DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("MON DBCS Vac Log").Visible = False
Sheets("MON OSS Vac Log").Visible = True
Sheets("MON OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("MON OSS Vac Log").Visible = False
Sheets("TUE Assignments").Visible = True
Sheets("TUE Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("TUE Assignments").Visible = False
Sheets("TUE DBCS Vac Log").Visible = True
Sheets("TUE DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("TUE DBCS Vac Log").Visible = False
Sheets("TUE OSS Vac Log").Visible = True
Sheets("TUE OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("TUE OSS Vac Log").Visible = False
Sheets("WED Assignments").Visible = True
Sheets("WED Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("WED Assignments").Visible = False
Sheets("WED DBCS Vac Log").Visible = True
Sheets("WED DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("WED DBCS Vac Log").Visible = False
Sheets("WED OSS Vac Log").Visible = True
Sheets("WED OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("WED OSS Vac Log").Visible = False
Sheets("THU Assignments").Visible = True
Sheets("THU Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("THU Assignments").Visible = False
Sheets("THU DBCS Vac Log").Visible = True
Sheets("THU DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("THU DBCS Vac Log").Visible = False
Sheets("THU OSS Vac Log").Visible = True
Sheets("THU OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("THU OSS Vac Log").Visible = False
Sheets("FRI Assignments").Visible = True
Sheets("FRI Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("FRI Assignments").Visible = False
Sheets("FRI DBCS Vac Log").Visible = True
Sheets("FRI DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("FRI DBCS Vac Log").Visible = False
Sheets("FRI OSS Vac Log").Visible = True
Sheets("FRI OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("FRI OSS Vac Log").Visible = False
Sheets("SAT Crew Tags").Visible = True
Sheets("SAT Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("SAT Crew Tags").Visible = False
Sheets("SUN Crew Tags").Visible = True
Sheets("SUN Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("SUN Crew Tags").Visible = False
Sheets("MON Crew Tags").Visible = True
Sheets("MON Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("MON Crew Tags").Visible = False
Sheets("TUE Crew Tags").Visible = True
Sheets("TUE Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("TUE Crew Tags").Visible = False
Sheets("WED Crew Tags").Visible = True
Sheets("WED Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("WED Crew Tags").Visible = False
Sheets("THU Crew Tags").Visible = True
Sheets("THU Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("THU Crew Tags").Visible = False
Sheets("FRI Crew Tags").Visible = True
Sheets("FRI Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("FRI Crew Tags").Visible = False
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Main Menu").Select
MsgBox_10
MainMenu
End Sub
|
|
|
|
|
You can see what it does. Alternatively you can run the code and watch it happening.
|
|
|
|
|
I run the code (F5) but I can't see what it actually does.
|
|
|
|
|
Then you need to compare the workbook before and after, and check that all parts of the code are working correctly.
|
|
|
|
|
Try using F8 and going through it step by step
|
|
|
|
|
Hi, i am working in VB 2010 an a one-time pad software.
The problem is the following. I have a txt file with many continous characters like this "KHKJHDKJDHAKHDAKHDAKHAKDHADHAKJDHASJDHA", i need to read a variable number of this characters and after replace it with a same number of dots (Ex. "zxsd" replaced with "....").
Now, with this code i can read the characters from specific position:
Using stream = File.OpenRead("c:\key.txt")
stream.Seek(v, SeekOrigin.Begin) ' v = startup position for read in file key.txt
Dim b = New Byte(a - 1) {} ' a= lenght of text in key.txt to be taken)
stream.Read(b, 0, a)
Dim str = Encoding.ASCII.GetString(b)
txtPad.Text = str
End Using
But how i can do for replace text extracted with dots without delete any line?
|
|
|
|
|
Why would there be line breaks in the OTP file which aren't meant to be part of the OTP data? Doesn't make much sense to me - if you're at liberty to change that, I would recommend to do so.
First, you'll have to open the file for read/write access instead of read-only. Then, after reading your OTP string, you'll have to seek again to the position where you started to read it. Then you'll have to write the replacement-string there. There's more than one way to do this - one way would be to convert the source string into a char-array, loop over the characters in that array and write a dot to the file for every character that isn't part of a line break and write line-break characters unmodified to the file.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Uhm why not read in the string and use string.replace() or am I missing something?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
For that he would have to have the substring-data that should be replaced as a string but it shouldn't be needed as a string for any other purpose, if I'm interpreting things right. Instead he should be looping over the single characters anyway in the encryption part.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Hi Sascha, let me explain better, my project is a Vernam chat and i need to have one single keys txt file that must remain synchronized in some way between broadcaster and receiver. When I send the message the key used must be deleted and who receives after decripting too. I thought at line numbers of string to identify the key location, but I am open to other solutions.The goal is synchronizing the two key files!
|
|
|
|
|
Imagine your OTP file is just a sequence of bytes (or ASCII characters if you like). The message you want to encrypt is 100 (ASCII) characters long. The sender reads the next 100 characters from the OTP file, encrypts the message and sends it. The receiver sees 100 encrypted characters and also reads the next 100 characters from the OTP file to decrypt the message. Both sender and receiver know the length of the message, so they can update the position from where to read the next OTP-characters by the same amount. No line numbers needed.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
That is a bad way to do it, and can lead to corruption of your files. A much safer option is to use two files, one for input and one for output. Read the input file and copy the content to the output, replacing the required characters in memory as you copy. When you have successfully copied all the data you can delete the input file, or rename it to save as backup. You can then rename your output file to the original name of the input.
|
|
|
|
|
Good observation, but would be not preferable for a crypto chat read and write continuously wholly key file (size about 10 Mega) when just overwrite the first part of the file. I seek only a comfortable way to synchronize key file between broadcaster and receiver.
|
|
|
|
|
Fine, do it your way. But make sure you test your code to destruction before you use it on live data.
|
|
|
|
|
You could use a second file for just storing the position from where to read the next OTP-characters and leave the OTP-file unchanged.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Hi,
I have a fileupload control on a web form, along with an upload button and a radio button list of file types.
There exists the possibility that the user could click the upload button before selecting a file in the fileupload control which would generate an error message that would be displayed asking them to select a file first.
The issue is; if this situation occurs, the message remains on the screen, even after they select a file.
Is there some way to add a reset method to this control, so the previous error message gets cleared when the fileupload control is selected?
I tried a few things already and as you can probably guess, they all failed.
Red.
|
|
|
|
|
Yes, but it kind of depends on how you've implemented it so far. But basically add an onfocus (JavaScript) event to the fileupload control and in that clear the message - to do this you'd obviously need to first of all make sure its been written to a DOM element you can access.
|
|
|
|
|
Hello,
I am automating the website ("http://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html") filling using vb6.
The code which works in IE10 & below is given here,
Dim WithEvents Web As SHDocVw.InternetExplorer
Private Sub Form_Load()
Set Web = New SHDocVw.InternetExplorer
Web.Visible = True
Web.Navigate "http://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html"
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error GoTo aaa
msgbox " URL: " & URL
if url = "http://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html" then
Web.Document.getElementById("Login_userName").Value = "abcde1111h"
Web.Document.getElementById("Login_userName").onchange
Web.Document.getElementById("Login_password").Value = "123456789"
Web.Document.getElementById("dateField").Value = "15/09/1954"
end if
Exit Sub
aaa:
MsgBox Err.Description & " URL: " & URL
End Sub
Private Sub Web_OnQuit()
MsgBox "OnQuit fired"
End Sub
In IE11 (Windows 10) I am facing the following problem with my code,
when navigated to above URL using SHDocVw.InternetExplorer control
First DocumentComplete event will be fired with URL being empty.
Then OnQuit event is fired. Then again DocumentComplete event is fired with URL 'about:blank'
When I run the exe with ‘Run as admin’ option then it works in IE11 without any errors.
Why in IE11 normal run is giving error ?
Please help.
|
|
|
|
|
Why are you using VB6? It was obsolete about 10 years ago!
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Good luck with that!
Trying to diagnose a problem with an application that has not been supported for over 10 years when running on the latest OS and browser is probably one of the most futile excercises I have heard of in quite a while.
You should have had a strategy to address this type of issue 10 years ago, now I suspect you are going to have to rewrite the web site with some urgency.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The time has come for you to get rid of VB6 and rewrite to .NET.
Good news = you can get free versions - see Visual Studio Express[^]
Better news = there are loads of articles around to help you achieve the rewrite in super-quick time e.g.
Internet Explorer Late Binding Automation[^]
Automation of Internet Explorer Using shdocvw.dll and mshtml.tlb – A Case Study[^]
But back to your original question...
The WebBrowser control stores it's recent history in a cache on the hard-drive. It's likely that IE11 is exercising greater control over access to certain folders, or rather greater adherence to the rules. You could check this out by using SysInternals ProcMon to monitor what is happening under the covers - Process Monitor[^]. (It's free and it's M$)
Obviously when running as Admin those areas of the hard disk become available.
You could try disabling the write to cache (caveat I have no means of testing this any more)
Web.Navigate "http://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html", 8
|
|
|
|
|
i cant find and cant start to code how to calculate networkdays because i have no idea to do it. can someone help me? by giving me an example coding in calculating networkdays between two dates?
|
|
|
|
|
What are networkdays?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Ok. NetWorkDays[^] is an excel function to work out the number of working days between two dates, taking into account (optional) holiday dates provided.
There is this article on CodeProject - Excel NetworkDays for C#[^] ... yes, it's C# but there should be enough information there to get you started. Come back if you get stuck
[Edit - an alternative, sorry it's C# again] Business Dates Calculation[^]
|
|
|
|