Two Different Passwords Without Debug
I have a problem with a HUGE macro project I'm working on. The macro itself isn't huge, but it's being applied to about 10,000 files. The macro is updating information on three spreadsheets in each workbook, but the problem is that the password protection (and Macro in general) fails to unlock when the password was entered in UPPERCASE. So the password is "king" and/or "KING" depending on the sheet. There is no way of predicting which sheets will be caps and which will not, but it's frustrating when my macro stops every 5 files with an error because of a wrong password (even though it's always one of those two).
Is there an IF THEN statement or something that I can do so that the macro doesn't stall every 30 seconds to 2 minutes... I have 10,000 files to crawl through.
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Controlling Several Passwords
how to liberate only the sheets already opened by this user, even after he/she has closed the workbook? It means that when this user re-open the workbook, only the password for this step (workbook) and of course for the sheets still closed (not yet visited), will be requested... There will be about 20 users, accessing the same file (at least 8 or 9 at the same time), and each one has a different level. For this reason the workbook is also protected: depending on the username and password, I'm trying let excel "knows" what sheet each user can open, without type a password again. trying to illustrating: (all users and password are added by me, using a MasterSheet) user1 ----- already unprotected sheet9 ----- can open sheet1 to 9 (no password, even re-opening the workbook) to open the sheet10, a username and a password are required user2 ----- unprotected sheet3 ----- can open sheet1 to 3 (no password, even re-opening the workbook) to open the sheet4, a username and a password are required ............. and so on.........
View Replies!
View Related
Hidden Tabs And Passwords
I have been doing a lot of reading on the forums here on hiding tabs and passwords for my current project...and suffice to say I am completely...totally...stuck. Basically, I have 11 different tabs that need to remain hidden until, the person clicks on a commandbutton which brings up a userform that asks for a password. Now - I have it set up that the user prior to this stage chooses thier location and it populates a label1 field on the password request userform. My biggest problem is this: I cannot seem to figure out how, in using a userform, to get the password to be recognized as TRUE....here is the Private Sub TextBox1_Change() a = UserForm12.TextBox1 If a "password" Then MsgBox "Wrong Password" Sheets("RatesII").Visible = xlSheetVeryHidden End If End Sub Now, my idea is that once the correct password is used, the userform dissmisses itself, the correct sheet is activated and unhidden for viewing and the user goes about doing what they do on this sheet. I will also have a button on the sheet itself titled something like "Update" which will save the sheet, and re-hide it and call up the userform once again...something I am a little scetchy on at this time though I immagine I will figure it out.
View Replies!
View Related
Create Alphanumeric Passwords
I would like to use an excel spreadsheet to generate a series of passwords. The password must include alphanumeric content, and be at least 10 characters long, and case sensitive. For example: 14sH2dA456a Thought about concatenting each variable, but do not know how to control the random variable creation in a spreadsheet? I have looked at RAND but can't figure out how to use it to any avail?
View Replies!
View Related
Passwords And Drop Down Lists
How would I write a marco that requires a password when a certain word in a drop down list is selected, bearing in mind that when this word is selected certain cells in the worksheet are no longer locked - in other words the certain cell can only changed by a specific person in the drop down list which when this person is selected a password is required.
View Replies!
View Related
Multiple Passwords In 1 Workbook
My workbook contains a number of worksheets - currently nine. Each worksheet details a specific "business unit" for the company I work for. Using VB, is it possible for Excel to request a password upon opening the workbook? If so, the specific password input would determine the specific worksheet(s) that are available for viewing.
View Replies!
View Related
Generate Unique Log In Passwords
I have a list of e-mail addresses stored in an Excel file (column A). I need to generate some passwords basing on these e-mail addresses which would then be automatically stored in the same row as the passwords, only this time in column B. The passwords could be numbers based on some text to number conversion (which I could additionally add some mathematical operation to, to make the password harder to crack). The passwods would then be distributed among the owners of these e-mail addresses.
View Replies!
View Related
Generate Usernames & Matching Passwords
I need some code that will generate passwords from a combination of a master password and other words such as a user name. I have seen references to use of the MD5 algorithm but would not know if or how this could be incorporated into vba. This would be used in an workbook which is distributed to different users. In order to use the workbook, they would need to enter their user name and password. The macro would check if these were correct or not. Because the password is generated by the macro, it avoids having to have them hidden in the workbook somewhere.
View Replies!
View Related
Multiple User Logins & Passwords In Workbook
how to create user logins and passwords for five users for one workbook. Also, preferrably to have a message to prompt for entering the user name and password at the first worksheet (e.g. the main page where there it is usually the company logo page) when the workbook is open. E.g. there are five employees and we would like to create five different logins and passwords for them. So when they open the workbook, it would be the first sheet of the workbook to appear first and they would then be prompt to enter their username and password. If one of the employees leave the company, we can still quite easily change the name to the new employee.
View Replies!
View Related
Debug Error 13
I have a working Excel 2007 macro that accesses two worksheets. I then added a third worksheet and want to access it from the macro. I get a debug error 13 Type Mismatch when the macro tries to access the third worksheet. I know I need to add the third worksheet on a pop-up but I don't remember how to open it.
View Replies!
View Related
Debug :: I Get: Division By Zero
When I debug this script I get: division by zero! In 3 lines over the debugging line, the script are writing out the variable "prosentref" as 1. Whatt can be wrong? (the value in cell T8769 is 1) Option Explicit Sub optimaliseringDrift() Dim Pgm1 As Integer Dim Pgm2 As Integer Dim PL As Integer Dim lamda_gm1 As Double Dim lamda_gm2 As Double Dim deriv1 As Double Dim deriv2 As Double Const Pgm1_max As Integer = 200 Const Pgm2_max As Integer = 300 Const Pgm1_min As Integer = 45 Const Pgm2_min As Integer = 40 Const deltaP As Integer = 5
View Replies!
View Related
Debug Statement
I am trying to put together an automation. I am having problem debuging the code. I am trying to have the automation autofilter with "Interior" and "Exterior" at column P. I am using a statement as follow to pick the cell that is showing at at second row each time after the autofilter ran. (the first row of Exterior and Interior are different) However, when i pick Exterior, the automation was able to locate the second cell after picking Exterior, but when I try Interior, then i will have a debug meesage. Range("Q2:Q" & Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(12)(1).Select The code that I used is as follow: Sub Macro4() Range("L1").Activate Selection.AutoFilter ' Selection.AutoFilter Selection.AutoFilter Field:=15, Criteria1:="=*Fixture*", Operator:=xlAnd Selection.AutoFilter Field:=16, Criteria1:="=" Range("P2:P" & Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(12)(1).Select ActiveCell.FormulaR1C1 = _
View Replies!
View Related
Debug.Print Cause Crashes
Continuing with my goal to learn VBA and while playing with the following code, I encountered strange behavior of debug statements. In the code below I have put my comments to identify where the "funny behavior" is encountered. Will appreciate if you can help me understand. I also have a simple request/question at the end of the code below: ....
View Replies!
View Related
Find Function Debug
What I'm doing in this script is taking a whole bunch of variables and pasting them into a seperate sheet "Checks" which will construct a cashiers check. The problem is where I've highlighted the code in red. At that point I have copied the Vendor name to the clipboard - I then go to the "Vendor Info" page and search for that Vendor name. If that name exists on the page it works perfectly...moving one column to the right, grabbing the Address Line 1 and dropping it into the check, then going back and grabbing the Address Line 2 and dropping it into the check. The problem is when that Vendor name doesn't exist in the "Vendor Info" page...I want it to just paste two blank cells into the check (because I obviously don't have the address info for that Vendor)...but instead it gives me an error: Run-Time error '91': Object variable or With block variable not set Sub Checks() ' ' Checks Macro ' Macro recorded 2/14/2007 by Derek Minner ' ' Keyboard Shortcut: Ctrl+Shift+P ' Selection.Copy Sheets("Checks").Select Range("I4").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
View Replies!
View Related
Debug F8 Stopped Working
I recently got a new laptop. I now have excel 2007 and vista. The debug step key, F8, does not work. It toggles out of excel when pushed. If I start the procedure in the debug menu, the SHIFT - F8 will step through though. Is there a setting I am missing? It must have somehting to do with VISTA since in the debug section it says to use F8.
View Replies!
View Related
Crash When Debug Addin
I am having a strange error occur. I am trying to debug a function in an add-in I developed, but whenever I try to hover over a value or add a watch, the whole application crashes. It runs without crashing when I don't try to debug it.
View Replies!
View Related
Customizing Debug Pop Up Window
If a user decides to hit the esc key right in the middle of one of my procedures (bug free, etc), this will leave the file in an odd state. The file is set up so if the routine is re-run it cleans the file up and restores it to proper form. But hitting esc exposes my code which is password protected when the file is idle. I employ a little trick that makes it hard to hack into my worksheet code, but one achilles heel is the esc button. What I want is to have the file close if the routine is stopped in mid stream. This way the code is not exposed, and the user cannot monkey with the file. I wanted to set the file up where i have a custom debug window that when a button is pressd the file closes OR when the user escapes out of the debug window the file closes as well.
View Replies!
View Related
Reading String Debug Kicking Out
I'm trying to create a macro that will send out emails to people based on an excel file that has 4 columns, nickname, purchased, owed, email address. I am able now to open the email, fill out to field, subject, body (mostly) and have it send if i change the code. The problem is kinda 2 part. I am trying to read in the amount owed cell (which is formatted to be $#.##) and then display that in the email, as well as reading in any other things and storing them to declared values. I am able to step through the code, but once it gets to the first part of reading in the nickname, it goes to the next line, you step through that, and then it immediately kicks out to the cleanup section. Below is the code... (Also, why is it that I need to set the row int to 1 insted of 2 (2 being where my data starts on the excel chart)). Sub TestFile() Dim OutApp As Object Dim OutMail As Object Dim cell As Range Dim row, purch, owed As Integer Dim nick As String row = 1 purch = 0 owed = 0
View Replies!
View Related
Debug Function Called From Another File
I have a macro that calls functions from another workbook. For example: Private Sub Worksheet_Change(ByVal target As Range) If ThisWorkbook.OpenCommon <> -1 Then _ Application.Run Workbooks("common.xls").name & "!Arkusz1.CellChange", target End Sub But when I get an error in CellChange function from "common.xls" workbook, debugger points only to the third line of the code above, not to the bad line in called function. Is there any way to change this behaviour (maybe some tool etc.)?
View Replies!
View Related
Macro Runs Fine In Debug But Not From ComboBox
I have a workbook that contains 9 worksheets. Four of the worksheets have the same row lables in column B and must always be the same. Three of the worksheets are fed from the 4th sheet so that the integrity of the lables is maintained. The user can change the lable value to meet their needs and they can insert or delete rows (within limits) as they see fit. The attached macro "Sub Delete_Row_All_Sheets()" works fine when I run it from Debug (F8). However, when I run it from Forms.ComboBox the macro returns to the "y = Application.InputBox("Enter The Row Number You Wish To Delete", _" screen. If I select cancel, the results I anticipated occur but I don't want the user to have to assume this will happen. Why does the macro return to this screen when executed from the ComboBox but not when executed from Debug?
View Replies!
View Related
Macro Works In Debug Mode But Not In Runtime
I am trying to open a xls file and convert into csv. My macro works when I'm in debug mode. but If i run the macro (Not in debug) mode then After opening a file control is not going to next function. What is problem? Even I am not getting any error too sub open file (FileName as string) Dim xlx As Object, xlw As Object, xls As Object, xlc As Object Dim RowNo As Integer Set xlx = CreateObject("Excel.Application") xlx.Visible = True 'Set xlw = xlx.Workbooks.Open(SourceFolder + "" + FileName) Workbooks.Open FileName:=SourceFolder + "" + FileName ' Columns("F:G").Select ' Selection.Delete Shift:=xlToLeft Save_in_WDrive (FileName) Set xlx = Nothing end sub
View Replies!
View Related
Debug Selection & Cash Register
I'm working on a sheet where I can specify sales by selection of month (Sheetname= ZoekenMaand). Everything works fine for the months "januari" and "februari" (yes, it's in dutch ) but from "maart" it doesn't seem to work any more.
View Replies!
View Related
Debug Code & See Results As Stepping Through
When stepping through my macro it moves through each line of the code showing me the code as it steps through. Is there a way to step through and see the results of the code as it is going through. I have an "IF THEN" statement in the macro that is not giving me any results so I think I must have an incorrect reference in the code, but I can't see it. I think if I could watch what it is supposed to be doing as I step through I might be able to find the error.
View Replies!
View Related
Allow User To Enter Break Mode (Debug)
i want to do is throw a break in my vba code if the user selects yes through a msgbox vbYesNo prompt and proceed in debug mode. is it possible to code in a break point in this fashion? my desired pseudo if user selects yes: set break point (to send to debug mode at that point... i dont mean to end the code with a END statement.) if user selects no: proceed program normally
View Replies!
View Related
Debug Assistance - Auto Date Entry
i try to lock cells in the area the VBA code affects. My goal is to actually have affected cells by this VBA code lock immediately after anything is entered in the affected cells. Area needing Debugging is in the If - Else portion. My worksheet will be protected. Private Sub Worksheet_Change(ByVal Target As Range) Dim LLoop As Integer Dim LTargetRange1 As String Dim LDestRange1 As String LLoop = 10 While LLoop <= 1000 'Link column B to A LTargetRange1 = "B" & CStr(LLoop) LDestRange1 = "A" & CStr(LLoop) If Not Intersect(Range(LTargetRange1), Target) Is Nothing Then If Len(Range(LTargetRange1).Value) > 0 Then Range(LDestRange1).Value = Date Else Range(LDestRange1).Value = Null End If End If LLoop = LLoop + 1 Wend End Sub
View Replies!
View Related
Pasting Data Debug Error On A Sheet With Borders
I have code that selects and copies data from one sheet onto another sheet. the sheet that is getting data copied too has borders defined. When i run the code i get a debug error. Here is the issue.... when i remove all the borders it works fine. I have tried everything i can think of to solve the problem but have had no luck. anybody have an idea what is causing this. i attached the workbook file so you can see what is going on.
View Replies!
View Related
Step Through & Debug VBA Macro Code
I don't understand the relationships that are happening and what the final value would be if for example the PT was Red. I'm confused and was curious how four lines could all equal different values(highlighted). UpUserPaint = UCase(RegPaint.Value) Dim icount As Integer LenRegPaint = Len(RegPaint.Value) For icount = 1 To LenRegPaint ValPAint = ValPAint + Asc(Mid(UpUserPaint, icount, 1)) Next icount If PTRed.Value Then ColorCompare = Abs(Pallet * (ValPAint + PrdtSeed - LenRegPaint)) ColorCompare = Abs( Round(ColorCompare / PrdtSeed - 7227, 0)) ColorCompare = ColorCompare And 6215971 ColorCompare = ColorCompare Xor 6215971.............................
View Replies!
View Related
Remove References Programmatically & How To Prevent Debug Error
i m working on an excel 2007 workbook with ms project functionality. in order to be able to use ms project from within excel i m using early binding. for those who dont know what early binding is: http://www.dicks-clicks.com/excel/olBinding.htm this works fine if the user has ms project installed on his/her pc. if the user does not have ms project installed i remove the broken references. this works fine. but my problem is that when i remove the reference to ms project, my vba project will not compile correctly. thus each time when a user opens the workbook the user gets a "compile error in hidden module" , since the functions of ms project are not available. for example i get a compile error in the following source Public Function getResID(ResName As String, ActiveProject As Project) As Integer Dim res As Resource For Each res In ActiveProject.Resources If res.name = ResName Then getResID = res.ID Exit Function End If getResID = -1 Next End Function i just want to know what i can do to prevent the compile error? would the use of late binding remove the problem? actually i dont want to use late binding since my source code is already very complex and it would be a huge effort to change it.
View Replies!
View Related
OpenText Function In Macro Hangs Unless Stepping Through Code In Debug
We have had a macro running for a few years (Excel 2007 now, but started in 2003) that imports about 35 text files into separate sheets, creates a calculated SUM field for each sheet and copies that value to a title (or summary) sheet. We use this 2 to 4 times per year at inventory time, copying to a new file and deleting the old data before running the macro. The imported files initially create new workbooks, but the data is copied to the initial workbook into a distinct sheets for each file. Recently (well, last August) this macro started hanging after importing (Workbooks.OpenText) a number of files, and not necessarily the same file every time (on repeated runs.) While trying to figure out the problem, I have now managed to get it to hang every time on the first file! However, if I am stepping through in the debugger it continues past the OpenText command and on F5:Run/Continue will then continue processing the rest of the files normally. If I delete the first file before running the macro, it then hangs on the second file instead. Without debugging, the first file will import, display on-screen, and there it stops. If I put a break-point on the very next instruction after the import, that break-point is never reached. THINGS I'VE TRIED:.......
View Replies!
View Related
Function Macro Debug: Continue Onto The Do Loop At The Bottom That Does All The Work
I am having a problem with a custom funciton I am trying to create. It will exit after it is finished with the IF Then Else statement. I need it to continue onto the Do loop at the bottom that does all the work. Function UPCECheck( num As String) As Long Dim CheckNum As Long Dim TempCheck As Long Dim X As Long Dim Holdtxt As Variant UPCECheck = 0 CheckNum = 0 Debug.Print Len(num) If Len(num) = 12 Then Holdtxt = num ElseIf Len(num) < 12 Then Holdtxt = "000000000000" & num Holdtxt = Val(Mid(Holdtxt, Len(holdtext) - 12, 12)) End If...................
View Replies!
View Related
Code "debug" Error 13
The two code extracts below are associated with two separate worksheets in the same workbook. They work fine. They simply are used to assign either a PO# or a Temp Unit #, located in a third sheet, in their respective sheets. The problem is that when I'm in either the Master or the Work Orders sheets where these two codes are used, and I do something simple like drag down some values or paste something in a cell, I get the "Run time error "13" type mismatch error" in the popup debug window for my VBA code. And in each case, it highlights the codeline I've color coded below:
View Replies!
View Related
Error In Runtime First Go, No Error In Debug Or Second Go
The code thats generating the error is the following: For Y = 8 To 131 TmpDate = Empty Range("A1").Value = "=" + Path + Sheet + "B" + CStr(Y) TmpDate = Range("A1").Value For Langd = 1 To Len(TmpDate) TmpChar = Mid(TmpDate, Langd, 1) If Not TmpChar = " " Then TmpComp = TmpComp + TmpChar End If Next Langd TmpDate = TmpComp TmpComp = Empty If Len(Dag) = 1 Then Dag = "0" + CStr(Dag) End If Macro continues before the Next-statement... (it might not be good programming, but I think it should work). A little explanation to the code. I have a spreadsheet located on the intranet that has values I need in my spreadsheet. These figures are sorted by date, so I search for the date to find the right figures. The line Range("A1").Value = "=" + Path + Sheet + "B" + CStr(Y) works prefectly. I can see the value in my spreadsheet in the cell A1. its the next line that causes the error "Type mismatch". The value I get from the intranet spreadsheet looks similar to this: "1 Jul 2006 " (note all the spaces). What I do is just run it through a loop and cut of all spaces so it will look like this: "1Jul2006" to be sure I dont miss a space or anything. Now to the funny part. The error only happens at runtime on the first go. If I chose to END the macro then and there, and then run it again from the top it works perfectly. If I set a stopsign to debug the code, it works perfectly on the first go too. Can anyone explain to me why that happens?? I know enough about programming to handle my syntax errors and so on, but I cant see anything wrong in this one... Please note that this isnt the the entire code. I'm building a report on 12 diffrent spreadsheet. The main macro is almost 2000 rows of code, and it call other Subs too (because of limitations in the VBA-editor. A macro cant to be too big), so its impossible for me to post the entire macro...
View Replies!
View Related
|