OpenLDAP Query - Whether Username Active Or Not

Mar 3, 2014

Please consider the following:





I am looking for a way to query an OpenLDAP instance, using the values in column A and looking up whether or not the username is active or not. The return value would be true/false in column B, which would indicate that yes, the username is active, or no, it is not.

View 1 Replies


Web Query. Log On Username & Password

Jan 9, 2007

code below, I need :

1) navigate to a web page
2) submit my userId and password
3) beeing redirected to a different url I have to menage this situation for passing url to
4) quering sub

I am using Excel 2000 with win98
Error 429 Can't create object:which one?

Public Sub First()
Dim obEx As Object
Dim obj As New MSHTML.HTMLBody
Dim strPass As String
Dim elUid As New MSHTML.HTMLInputElement
Dim elPass As New MSHTML.HTMLInputElement
Dim elSubmit As New MSHTML.HTMLInputElement
Dim strUid As String
Dim Desc As String

View 9 Replies View Related

Find Username Match And Pull All Data At Same Row W/username

Oct 5, 2007

I have a thousand names on a column, and I have a several worksheet tabs as locations, such as CA, AZ, TX, and NY.

All names goes to main worksheet, show like this

apitchford 10 100 123
bkishpaugh 9 211 123
blee 14 234 111
cbonny 21 125 412

I need to pull a specific name, example, name = blee, move that name with all data on that row into TX.

I will need to set as automatically, becuase the names add and delete on the main worksheet, and will auto update those tab worksheets. (make sense?)

I have tried INDEX and MATCH, but they keep putting one data in, not all data.

View 9 Replies View Related

Inserting Query Tables In Active Sheet

Feb 26, 2013

When using

VB :ActiveSheet.QueryTables.Add

How would you get the code to overwrite whatever is in the worksheet as opposed to adding new columns?

View 1 Replies View Related

Macro - Query Active Directory With Multiple Usernames

Apr 13, 2014

I am trying to query Active Directory for a list of user attributes by using a list of usernames and output the results into column B,C,D.....

All the usernames are listed in column A and it ranges from 100 to 1000 usernames.

The macro GetAdsProp works but it is very slow because it's a function and every time it gets called to return a value, it takes a long time to query. It will take forever to get 1000 users.

I've also tried the code below, however one of the AD attribute that I am querying for has a dash (i.e. test-address) and I can't put a dash in the vba code because it automatically puts spaces in between the dash and the text (see red text below) which will fail to find the attribute. Also, I need it to loop the whole column A and not just one account.

Sub LoadUserInfo()
Dim x, objConnection, objCommand, objRecordSet, oUser, skip, disa
Dim sht As Worksheet

' get domain
Dim oRoot
Set oRoot = GetObject("LDAP://rootDSE")

[Code] .....

View 3 Replies View Related

Pass Parameter From Excel Through MS Query To MS Access Query

Nov 26, 2012

I have an MS Access query that contains a parameter. The parameter is a date field, and I have configured that in the Access query. If I run the query within the MS Access user interface, it prompts me for the paramater value as expected, and runs just fine. However, I want to connect to this query from within Excel as a data source.

I have created a connection to the Access file using ODBC from within Excel. In the MS Query window, I am merely selecting all of the fields resident in the MS Access query, and returning all values. In other words, there is no selection criteria in the MS Query. I have done this many times with Access queries that DO NOT contain a parameter, and everything works fine. However, in this instance, I need to pass a parameter through to MS Access in order for the query to run. At the moment, I get the "Too Few Paramaters...1 expected" error message. This makes sense, because I haven't figured out how to pass the paramater to MS Access.

Is there a way to structure this that does not involve VB code? If so, I'd love to know how. I have tried creating parameters in MS-Query with the same name, but although I get the prompt it doesn't connect with the Access query as the source for the parameter value.

If the solution requires using code, I'm good with VB Code in there VB for Excel code that could make this happen?

Failing that, I guess there must be (I've seen a few in my search thus far) Access VB Code that can make this work. I'm very rusty using VB with Access, so this is my least favored solution. However, if this is the only option, keep in mind that I need to pass the paramater ultimately from a user who will initiate the process using Excel.

View 3 Replies View Related

Query Parameters Which Takes The Date From The Cell Into The Query

Mar 29, 2007

Need the query parameters which takes the date from the cell into the query. How should I modify my query if it needs to take the date from a cell?? The bold one date should be picked from one of the cell in sheet 2.

My query is this


View 2 Replies View Related

Create An Conection With MS QUERY To A Csv And Query Data

Sep 6, 2008

I have a csv file on another drive on the network that i need to query. I believe that ms query would be the best way. I know that a DSN needs to be setup but this macro will be used by various users who wont know how to do that. thus I would like to create one via VBA every time the task needs to be run.
I haven't a clue how to do this and i need it to be explained to me in general terms with words of one syllable!

View 9 Replies View Related

Query An Access Query With VBA Function

Jul 8, 2008

I'm trying to query a query in Access 2003, from Excel 2003.

The query in Access looks like:
AccessQuery: [SELECT VBAFunction(field1) FROM Table]

The query in Excel looks like:
ExcelQuery: [SELECT * FROM AccessQuery]

I use the following VBA code in Excel to excecute the query:

With ThisWorkbook.Worksheets(cDataSheetName).QueryTables.Add(Connection:=strConnection, _
Destination:=ThisWorkbook.Worksheets(cDataSheetName).Range("A1"), Sql:=strQuery)
.RowNumbers = True
.Refresh BackgroundQuery:=False
iResultRowCount = .ResultRange.Rows.Count
End With
When I execute this code I get the error message 'SQL Syntax Error' (Error 1004). When I remove the VBA function from the query in Access, it all works fine.

View 9 Replies View Related

Edit Query Using Query Wizard

Apr 25, 2006

I created an Ms Excel Database Query to bring in data from MS Access. (versions 2002 of MS Excel and Ms Access). The query works fine initially. I can right click, choose Edit Query and change my criteria. Results are returned almost instantly.

My problem is that, once I save the workbook, or autosave happens, I get an error when I right-click to Edit Query: This query cannot be edited by the Query Wizard..

View 2 Replies View Related

Find Method To Search For The Active And Non Active Values

Jul 14, 2009

I have a range of amounts in Sheet 1 from F7:Q13 and im using the find method to search for the active and non active values in the cell. Which means that if there's a value in the cell it will transfer the value in Sheet 2, if nothing is found in the cell the cells in Sheet 2 will return as nothing or null.

I think the problem lies on the FindWhat variable. Im getting a compiled error which im not sure what is it.

I've attached the spreadsheet so you get a better idea of the problem that i encountered.

View 13 Replies View Related

Macro With Reference To Active Chart On Active Sheet

May 14, 2014

I currently have the following macro running to set a chart's data values:

Sub C3Quarter12013()
' C3Quarter32013 Macro
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.SeriesCollection(1).Values = _

[Code] ......

When I copy the tab and change some of the data within the cells, I want the macro refer to the chart on the current tab and the values in the current tab - as currently it refers to only "Chart 2" and the values in the tab 'Figure 2 - WE OPH'.

I've tried changing the sheet name to but that doesn't seem to work.

View 4 Replies View Related

API To Get Username

May 29, 2008

I have Timesheet workbooks with 3 levels of access (user, viewer & me as developer).

I want use the GetuserName API function (with If/Then) to auto open the wkbk if I am loged in under my network login so psuecode looks bit like this

If network user is me then open wkbk
else ask for username & password

I have googled & searched the forum & the closest I have is this

Public Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function ReturnUserName() As String
' returns the NT Domain User Name
Dim rString As String * 255, sLen As Long, tString As String
tString = ""
On Error Resume Next...............

View 9 Replies View Related

Get UserName Or Log In Name

Nov 10, 2006

I've got a sheet with a "Last Edited By:" field and I want this to be populated with the current users name i.e. I suppose I mean the user name that is assigned to Excel, as opposed to the XP log in... although I guess either would do. I'm OK on the change event thing, but just dont know the function to find the the current users name.

View 3 Replies View Related

Insert Username Using VBA

Jan 17, 2007

I'm trying to use the code listed below on the works shared drive. When I open up the worksheet and save it, my log on identity is left as required in Cell B2 etc.. When someone else uses the sheet it just leaves the company name in this cell and not their log on identity? The date & time function always works ok. Can anyone advise me if what I'm after is achievable.

The code I've used below was used from a previous string on a similar question.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Now()
Range("A" & Rows.Count).End(xlUp).Offset(0, 1).Value = Application.UserName
End Sub[/b]

View 9 Replies View Related

Macro To Get Username

Jun 29, 2007

I have copied a macro off another board that get the username of the computer where the excel file is opened. It works fine on my pc but when I have sent the workbook to a colleague my username came up when he opened it. Also what I am trying to do is to modify the macro that does a vlookup on a range in worksheet 1 from where it picks name and surname (and transpose it onto worksheet 2 on cell A2), email (on B2), tel number (on C2) etc etc.

View 3 Replies View Related

Username / Password At Login

May 31, 2013

I have below piece of code which I'm not sure how to finish up. What I'm trying to do is have 'Username' and 'password' entered before logging into the workbook. It does not have to be 'UserForm" if it is possible, but it would be useful if we use Ucase...

I'm just not sure how this code works with

"Sub sUserLogon(strStandardID As String, strPassword As String)"

stated in this way..

Sub sUserLogon(strStandardID As String, strPassword As String)
Dim strUserName As String
Dim StrMessage As String
Application.DisplayAlertsAlerts = False
StrMessage = "User Logged In"

[Code] ......

View 2 Replies View Related

Unprotecting A Worksheet By Username

Dec 4, 2009

I would like to unlock the work sheet based on the username. However this code does not seems to be working.

The object is that only these users have access to the locked cells on a sheet and those users not on the list would only have access to the unlocked cells.

View 3 Replies View Related

Time And Username Stamp

Oct 21, 2011

This time stamp macro is great but I would also like to record the person who said 'Y' in the same cell as the date stamp '12:00p.m. MWatson'. The persons name should come from the Username.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range([P13], Cells(Rows.Count, "p"))) Is Nothing Then 'change your range on this line"
With ActiveSheet
If Target.Value = "Y" Then
Target.Offset(0, 1).Value = Now

[Code] ........

View 2 Replies View Related

Print Username In Footer?

Nov 26, 2012

I would like the name of the User to print in the Footer in Excel.

View 9 Replies View Related

VBA (IE Enter UserName And PassWord)

Feb 7, 2007

I am using the below code to access a website with IE.

My next step (of many) is to Login to this website.

The login screen requires that I enter:
User Name:

How can I tell IE to enter my user name and Password?

Sub Macro2()
'Macro2 Macro
' Macro recorded 2/6/2007 by dsggodwin
Public Sub Goto_ToyotaSupplier_Click()

Set EXP = CreateObject("InternetExplorer.application")
EXP.Visible = True
'put the webpage here
EXP.Navigate ("")
End Sub

View 9 Replies View Related

Getting Username From System In A Cell

Apr 17, 2009

I am trying to get the username from the system to display in A1 in a file in Excel. I got this code form internet and put it in the sheet by clicking right mouse on the sheet1 tab and view code and then pasted it there.

Function UserNameWindows() As String
UserNameWindows = Environ("USRNAME")
End Function

And then as per the instructions on the same page I inserted this formula in A1 : =UserNameWindows()

The person stated that by doing this, I should be able to get user name displayed in A1. BUt all it gives me is #NAME?.

View 9 Replies View Related

Protect With Username VBA Content

Sep 28, 2009

i need a macro that will only open a file to certain users using the "get username" environ thing,

and only allow a list of users to access this file,

this will be a log of things that only managers whouls have access to, i have all the managers usernames (windows log ons) and what i need is that if the log on on the current machine, (the one currently opening the file) does not match one on th elist then the file should not open.

i could pasword protect the file but since my managers are kinda lazy and i wnat to show off a little (maybe hopefully that will push my promotion forward a couple of days at least)

View 9 Replies View Related

To Submit UserName & Password On IE

Feb 18, 2010

I'm trying to create a program that will automatically log in to a website that requires a username & password. I am able to enter the username and password in the correct text boxes, but I can not get the form to submit to approve the login. It refreshes and removes the password.

I have attached my code. The web url is inside it.

Sub IE_login()
Dim ie As InternetExplorer
Dim C
Dim ULogin As Boolean, ieForm
Dim MyPass As String, MyLogin As String
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate ""
'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE

View 9 Replies View Related

UserName For Access To Second Workbook

Jun 16, 2006

I have a problem with the Excel UserName & opening of a second xls File. Info:
The first file macro, looks as to the Excel UserName, and sets which worksheets from a second file in the network the person can see. then changes the Excel UserName to "helpdl", this is done because only 4 people have access to the Workbook on a network drive, see Code below (only the interesting part of the macro)

'Set the Excel UserName to "helpdl"
'(from Sub Change_UserName)
MyName = Application.UserName
OName = MyName
NewName = "HelpDL"
UserName = NewName
'Set the name of the Active File To "Slave"
Set wbSlave = ActiveWorkbook
'Open the Master from the Network (Wiesbaden server sv030100)
Workbooks.Open "\sv030100GruppenDL60116_MEWA Car Policy_Neukonzeption.xls"
'Set the name of the Active File to "Master"
Set wbMaster = ActiveWorkbook...........................

View 2 Replies View Related

Get Username & Use To Change Directory

Oct 2, 2007

I have an Excel macro that pulls an external .txt file from a particular directory on a users computer. The directory is different for each user because of the way the computers are configured, see example below.

Bob's computer:

Jill's computer:

There is a system variable called %username% on each computer that can be used for navigation in an OS enviroment. So if you were at the command prompt on user's computer and typed cd\%username%work you would be put in the desired directory. Is there a way to leverage this system level variable, %username%, in an Excel macro?

View 2 Replies View Related

Incorrect Username For Workbook In Use

May 14, 2008

Usually when you try to open a file that someone else is using, it lets you know the file is in use, and lets you know who is using it. However, the situation I have is that when a user tries to open the file that is in use, it tells them that the file is in use, but gives them the wrong user who is using it!

For example, User1 opens the file and closes it again. User2 comes along and opens the file and stays in the file. User3 comes along and tries to open the file, but instead of saying User2 is using the file. It says User1 is using!

The file we have was originally built in Excel 97, but we using it through compatibility mode in Office 2007. The file is needed by various users, but putting it on shared access is not an option.

View 9 Replies View Related

Extracting Username From A List Of Tweets

Dec 21, 2012

I have a list of tweets, and I would like to extract just the username found within the tweet. I'm not sure if a formula is the best way to do this, or possibly a macro.

The example I've attached is only of 18 tweets, but the spreadsheet I'm looking to use this on is 100,000+ tweets, so I need something easily scalable. One thing to note is that a tweet can have more than oneuser mentioned in it, such as the first tweet in the example.

Tweet Example.xlsx

View 13 Replies View Related

Unlocking With Username And Autolocking When Save

Feb 13, 2014

Excel can automatically recognise individuals by their windows login name so you can fully automate the protect/unprotect of the correct sheets without even individuals having to use passwords.

The first step though would be to gather the id's of all users.

1. Create an additional sheet and call it UserLog
2. Put the following code into all the worksheet code modules

[Code] ......

Once you know the windows login names and which sheet they are responsible for you can add the following code to each worksheet.

[Code] .....

I have tried as per below and it is not working.

I have about 50 user that uses one document and will record their comments to instructions, but only 20 users will be able to add the instructions. The document needs to autolock when it is saved and can only be unlock with the username of the 20 users.

View 1 Replies View Related

Show / Hide Sheets Per Username

Mar 8, 2014

I'm trying to only show specific sheets per user using the environ variable and this code seems to work for the single user / sheet but the master user does not function correctly i.e. the code does not show all sheets, this is the code I am using:

[Code] ......

Why the above code does not respect the Master User "Jane" should be able to see all sheets?

Original source for this code was found here:

HTML Code:  [URL]....

View 7 Replies View Related

Copyrights 2005-15, All rights reserved