Worksheet Access Log
I want to create a log of everyone who opens a particular workbook. I'm using Excel 2003. I found this macro, and created a worksheet called "Log", but I've opened the workbook several times and nothing appears on the Log sheet.
View Complete Thread with Replies
Related Forum Messages:
Access Another Workbooks Worksheet
In another thread I was able to access another workbook with a listbox.
I'm now trying to do the same thing with a command button. Here's what I have so far without success.
Private Sub CommandButton4_Click()
The file path being C/Documents/Estimate_Database
Best Way To Populate Worksheet From Access Database
I have an excel worksheet that I need to populate with a few thousand data points from MS Access. Currently I do this through vba code somewhat similar to this:
rst2.Open myQueryString, cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
Do Until rst2.EOF
wsht1.Cells(1+counter, 1) = rst2!val
counter = counter +1
Now this method works, but it is pretty slow to load. I remember reading as a general excel optimization technique you should avoid using long loops accessing cells on an individual basis.
Is there a better way for me to dump large clumps of Access data into Excel, instead of populating it cell by cell?
Macro To Access Worksheet Via Popup Box
I have a macro below that gives me a popup box that lets me type in the new sheet i want to access. etc(sheet1.xls) It give me 2 boxes one i must type the old sheet i currently access etc(sheet0.xls) and the next is the new sheet i will now be accesssing.
Is there a way to change this so i only get one box that will let me type in the new sheet i want to access?
Exporting Worksheet To Access Table
I have a script that exports an excel worksheet into an access db table and thsi is working fine. However i want to define a specific worksheet where the data is being exported from within the code but im having trouble doing, its using just a range at present.
Restrict User Access To Worksheet
I am creating a spreadsheet for work - I have a column that is all the formulas projected sales minus actual sales.
I need to lock this column so that no one BUT MYSELF can change the codes. In other words "idiot proof" the worksheet. there are only 18 sections that I want anyone else to be able to type in.
is there a way to do this without adding users? half the ppl have personal emails and half have company emails.
MS Access Data Import Into An Excel Worksheet.
I currently have a userform, and on commandbutton_click, it performs
the following code that adds a column in a access table to a combobox(cbList)
Private Sub CmdName_Click()
Dim rstName As ADODB.Recordset
Dim strClientDatabase As String, strConnectionString As String
strClientDatabase = ActiveWorkbook.Path & "9001.mdb"......
After its listed on the combo box, upon commandbutton_click on another button, i wish to extract a particular record, based on the selection made on the combobox(cbList). This is where im having problems caused i have no idea how to do so. I just want it to extract the particular record row, based on cbList, and insert it into range A100:D100 in a particular worksheet. It is then updated and added to a listbox which ive already done the coding for, and with another button click it would add the details in the listbox into the appropriate location i wish to.. The only place im stuck is with extracting the data from access into a A100:D100 range in any worksheet. what ive come up with, but is incomplete is :
Private Sub CmdImport_Click()
Dim adoRS As ADODB.Recordset
Dim strSQL As String
Dim strClientDatabase As String, strConnectionString As String
strClientDatabase = ActiveWorkbook.Path & "9001mdb"
Access Worksheet Controls Properties & Methods
I am trying to implement code that can handle a dynamic number of objects, specifically check boxes.
I know of eval( ) in perl that allows one to dynamically create command lines. For instance, the following code would change all of the Checkbox values to 1. The syntax may not be correct but the idea is solid.
Do While i < num_checkboxes
eval("Checkbox" .i. ".Value=1)
Does this funtion also exist in excel?
Access/read Data From A Hidden WorkSheet
I'm trying to access/read data from a hidden WorkSheet in Excel 2003 using:
**** Data ****
The accessed **** Data **** refers to another ('unhidden') WorkSheet. How can I read the data without making the WorkSheet visible to the User?
Show Worksheets Tabs On Current Worksheet For Easy Access
You could use:
If ActiveWorkbook.Sheets.Count < 17 Then
Application.CommandBars("Workbook tabs").Controls("more Sheets...").Execute
The code doesn't do anything on my excel workbook which currently has like 20 workbooks, and it grows daily by like 4 or 5 worksheets.
Programmatic Access To Trust Access To Visual Basic Editor
I am Generating Excel file with Macro using my asp.net (c#) application.
I am able to generate Excel file in development environment, but in Production it gives following error:
"Programmatic access to Visual Basic Project is not trusted Line: Microsoft Office Excel"
I did googling a bit and found that I have to open Excel file physically make few security related changes in macro as below.
1. Open the Office application in question. On the Tools menu, click Macro, and then click Security to open the Macro Security dialog box.
2. On the Trusted Sources tab, click to select the Trust access to Visual Basic Project check box to turn on access.
3. Click OK to apply the setting. You may need to restart the application for the code to run properly if you automate from a Component Object Model (COM) add-in or template.
Can i do above changes at runtime (using some code)?
Access-Like Report Without Utilizing Access
I have an Excel file ( named "Classes.xsl"), that has a worksheet (named "RawData") that is layed out something like:
Name Dept Class
John 0547 Class 1
Jane 0368 Class 1
Jim 0368 Class 2
Sue 1235 Class 2
I am trying to get an Access-Like report without utilizing Access. Is there a way to generate a report similar to below using Excel as the data source (could be mail merge, perhaps a macro with a printout) I am not sure which way to try and was hoping someone could point me in the right direction...and possibly provide an example.
Class EnrollmentClass 1John 0547
Jane 0368Class 2Jim 0368
Access Vs Excel As A DB
There are many examples and aspects to compare these 2 products but I just want to point one little difference which is quite crucial and interesting.
Generally if you use small amount of data - 1 Worksheet / 5000 rows / 20 columns you can use Excel without bothering about the execution time, queries and work fast and convenient with it.
The point on Excel is that in 1 Column/Row you can differently Format the data(cells). For example - format as Number or Hour the cells in Column B depending on the data in other columns. That saves you from making 2 Columns - one for Numbers and another one for Hours. This helps you to save 1 of the columns when the data structure in other column is the same.
In Access (and generally all SQL DBs) this is not possible.
Excel Or Access?
I need a front worksheet with either buttons or tick boxes that will list different options for a machine
Once a tick or push button is activated a hidden block of text related to that specific tick box needs to be selected and placed onto a final print out sheet (allocation)
when futher boxes have been ticked I would like all the information blocks to build up on the final print out sheet.
Using Access 2007
I have an Excel spreadsheet that I have developed into an over the top flight calculator/scheduling tool. I am using Excel because developing this prduct into a stand-alone program would be absolutely murder to get approved for use on my network.
Since Excel and Access has already been approved, I began coding this project there.
Now that my calculator functions are nearly complete, I am beginning to develop a database of airfields and other misc. flight data that I and others on my network can see and manipulate. To make my calculator funtion at 100% effectiveness, I will need to use VBA to open the Access DB and pull out specific data. I will also need it to open and display some Access pop-up forms that I have just developed. Does anyone know what code I would use for excel to display and retrieve Access' information?
Getting All Data From Access
i have an access database and is using excel to get the required data from the access database. I am basing on department to filter out the required data into excel. Below is the VBA code i use
deptClause = Worksheets("Records").range("C1").Value
If Not deptClause = "All" Or deptClause = "" Then
requestClause = " WHERE Department='" & deptClause & "'"
Queryline = "Select * from FailureQuery" & requestClause
the problem is i got one selection "All" in worksheet "Records" in cell "C1" and i cannot get this function to display all the data from the access. however when i choose a particular department it will show fine.
Formatting Using Access VBA
I have the following code set up and every works except for PaperSize and Margins. Is there a standard VBA code reference available somewhere that addresses Access to Excel operations? Thanks
.PrintTitleRows = "$1:$2"
.PrintTitleColumns = "$A:$C"
.LeftHeader = "XYZ Financial Wonks, Inc."
.CenterHeader = ""
.RightHeader = "COMPANY CONFIDENTIAL"
.LeftFooter = "&Z&F"
.CenterFooter = ""
.RightFooter = "&P of &N"
' .LeftMargin = = xlSheet.InchesToPoints(0.25)
' .RightMargin = xlSheet.InchesToPoints(0.25)
' .TopMargin = Application.InchesToPoints(0.25)
' .BottomMargin = Application.InchesToPoints(0.25)
' .HeaderMargin = Application.InchesToPoints(0.25)
' .FooterMargin = Application.InchesToPoints(0.25)
.PrintHeadings = False
.PrintGridlines = False....................
Formula Or Access
I have a very unuserfriendly report that looks like this
State - ype - County/City - Invoice # - Ref # - Amount
UT - Tax Billed - Salt Lake - 073714 - 238025 - $10.82
UT - Taxable Sales - Utah - 073714 - 238025 - $983.75
UT - Tax Billed - Slt Lk Cnty 073714 - 238025 - 4.92
UT- taxable Sales Slt Lk Cnty 073714 - 238025 - 983.75
UT - Tax billed - Utah - 073714 - 238025 - 46.73
For sales tax reporting we need to know the state, city, county district
amounts. This would be simple if we could just sort by county/city, however
we cannot because the state tax piece only only shows the word "UTAH" it does
not give a city or county name. So we must sort by invoice #. This would be
ok if we only had a few invoices in each city such as Salt Lake but we have
have 40 or 50 invoice numbers in salt lake.
I need to find a way to keep all of the tax pieces that belong together, and
subtotal by city/county. I thought if I had a formula that could change the
state name "UTAH" to reflect the city for that invoice. This is the case for
all states. Each state is 10,000 or more lines. I need to somehow grouping
the information I need. I used the pivot table approach. However, since I
must sort by invoice I still have 10,000 lines. I want to sort by invoice to
get all the pieces then sort by county city. Any ideas of how I can do this?
something in Access perhaps? a formual in excel perhaps?
Disallow Access To Add-ins
I am trying help protect a project from all my colleagues that have a version of password breaker that is actually an add-in. I have already managed to disable or grey-out all of the other commandbar options that I don't want them to have access to during their use of the model but can't figure out how to disallow them from accessing the "Add-ins" option from the "Tools" menu. I can, of course, disable the entire tools menu but don't want to do that yet.
I'm trying to build a query which matches two tables which say has a number like A#### , I want the query to give me the A number's which do not belong in the second table but which do in the first table. i believe i need an SQL query to do this?
Converting From Access
I am trying to convert An Access macro/function programs to Excel and I am having trouble processing the following in Excel:
Set rsbuildinforce = CurrentDb.OpenRecordset(InfTable)
(InfTable) is defined as an Access linked table name. The values of columns in rsbuildinforce drive the logic of the macro/function
The object of the program is to read in data from excel, do some manipulations, reformatting, etc... and output .csv files.
Using VBA To Access Information In SQL
I need to compare data on a spreadsheet to data that resides in SQL database. I have never done this before so before I start I wanted to ask a general question, what is the cleanest, simplest, way to go about this. I read that ADO is a good way to access SQL. I understand that ADO is one of the main components of MS universal data access specifications so it sounds like the right approach (and that ADO is replacing DAO).
In terms of application, all I want to do for now is pull data from SQL and write it to a worksheet in the Excel workbook. Other macro's will then operate on this data. Later I will want to write data back to SQL but I want to focus on the "get" part first. Are the statements SELECT; INSERT; UPDATE; DELETE examples of ADO coding?
Conceptually, the SQL team provide nightly tables of data; ADO retrieves some of that data by selecting it; The selected data is written to a worksheet within the workbook. Is this a good approach?
Sql Import To Access
The size of the table I'm importing will change, so i would like for the code to not matter on size. Also its, gonna be large too. The sheet will always be the same and the column headers will match for excel and access.
Access From Different Logins
I have created few excel files from "X" login account and when i try to open it from the "Y" login account, it opens it in the read only mode. do you know how to access it from Y account in the edit mode or the write mode.
Cannot Access UserForms In Add-in
I would really like to be able to have a function in a workbook that can run methods (for example Show or Hide) on a UserForm inside an add-in like this:
Public Sub Test_Addin()
where frmTest is a UserForm inside the addin. After the add-in has been added as a reference, I am able to access all of its functions/subs in this way. When I try to access a form inside the add-in from outside the add-in, I simply get an object not defined error. Looking more closely, if I type in "eRFTEAddIn." (which is the name of the add-in) and look at the possible options, the forms do not show up...although the modules and sheets do.
Access Databse Connections In VBA
From within VBA I need to open a database connection and issue a select and store the results in my spreadsheet. The issue is that I only JUST learned that you can do this and I dont know where I can look for instructions. Incase it matters, I am trying to connect to a Sybase DB. I have used perl, c# and a little bit of Java to do this but never from with in Basic (let alone basic within excel!)
VBA Access To Xlveryhidden Sheet
I used the xlveryhidden method to hide a worksheet that contains all of my validation lists for drop-down range names. Unfortunately when I try to access the sheet without unhiding it, I get a Microsoft Visual Basic Run-time error '1004': Select Method of Worksheet class failed
Is there a way to let VBA access the xlveryhidden sheet through a macro without unhiding the sheet?
Importing Data From Access ..
I need to import data from an Access table (which is straightforward enough), but there's a snag.
All the rows are dated (10 rows per day) and I want to start from a specific date and get everything after that date.
Anyone any ideas if this is possible and, if so, how to do it?
USerId And Password To Access A WB
I have made an excel file the use of which I want to restrict to a few people. So I want that whenever the user will open the file it will prompt for user id and password. If these matches then he will be allowed to access the file. Thre types of user id and password is required:
User! : Can modify, edit, delete, etc ie full access (Adminstrator type)
User2: Only access to print (no entry,edit,modifiaction,etc)
User3: Only be able to see the file and no print,entry,etc access.
If all are not possible, then provide code for part.
Macro will always be enabled as I found code on the net to force user to enable macro. ie if macros are not enabled, it shows another rough page. So enabling macro is not a problem.
Populate Combobox From Access
i have the following
Dim cn As ADODB.Connection
Dim qc As ADODB.Recordset
Dim Equip_File As String
Dim Equip_ID As String
Dim Equip_Param As String
Set cn = New ADODB.Connection
Set qc = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\ServerDISK 1UncertaintiesUncertainties.mdb"
'Populate QC Number Dropdown menu
qc.Open "SELECT [Equipment_QC] FROM [Equipment_Table]", cn, adOpenStatic
Do Until qc.EOF
Equipment_Title.Text = rst.Fields.Item("Equipment_Title").value
however, i cant seem to populate the list, i get error :424 object required
is this because the first record in the db has the Equipment_QC field blank? i need to be able to have blank fields..
Import From Access Using Excel VBA
I use Excel 2003 and am trying to import information from an access database. The recordset I am looking for is based on Cell B3 on a worksheet named Import.
Is there a way that Excel VBA Can do this?
The recordset contains text in the standard of Memos, Will I be able to import the entire Memo?
3 Layer Relationships - Vba? Use Access Instead
hi trying to vreate a table for user to upload data. some fields have a relationship and can only select ceratin things from a list dependent on what the previous columns selection is.
Column A selects from defined list 'animal' -cat, dog, mouse
Then if they select "cat" columc c uses define list 'cats' = siamese, persion, mungrel
but if they select dog it will force use of defined list 'dogs' = poodle, labrador, mungrel...
but i then need to add a third layer to this!!!! THIS IS WHERE PROBLEMS BEGIN!
2 layer is fine for : http://www.contextures.com/xlDataVal02.html
but this will not work if for 3 layer..... example colum b, could be a dog or a cat, if mungrel is selected. if the 3rd column depends on both of these ie it matters what column a and b is before 3rd list is defined.....
plus im going to have about a hundred defined lists at this rate.. and ther will be other realtionships in the same table.... :S
i have the relaonships in the format of a list of possible combinations i.
A B C
cat siamese grey
cat siamese black
cat persian white
cat persian black
cat mungrel ginger
dog poodle black
dog poodle pink ....
dog mungrel white
dog mungrel black
There must be an easy way!!!! do i have to use Access?
Add Data To Access Database
Is there a way for an excel macro to open a access database & import a txt file straight to access (without importing to excel first) & then executing some other code e.g. copy query results(which i already have code for)
Open An Access DB From Excel
I am trying to open an access database from excel by clicking a button. I have assigned the following script and modified it for my own use as according to the microsoft kb.
Private Sub CommandButton2_Click()
'Opens Microsoft Access and the file nwind.mdb
Shell ("c:Program FilesMicrosoft OfficeOFFICE11MSACCESS.exe T:TSD - UKProjectsSteve's ProjectsT3FCRs.mdb")
'Initiates a DDE channel to Microsoft Access
Chan = DDEInitiate("MSACCESS", "system")
'Activates Microsoft Access
'Runs the macro "Sample AutoExec" from the NWIND.MDB file
Application.DDEExecute Chan, "ImportData"...........
Export Sheet To Access ...
Im looking to export a sheet from excel to access. The sheet has the same tables as does the access database. I need the code for this because I dont want to have to import from access manually each time.plus my users only have permission to use the excel sheet, as I dont want them messing with the info. Any Ideas?
Import The Last Row An Access Table
Is it possible to import the last row an Access table into Excel either through VBA or an excel function.
I need it to be only the last row, due to the size of the database, I have tried importing using a query but this takes a long time as it checks each row first.
Is there a way to find the last row automatically a bit like this in excel.
myendrow = sheets("sheet1").range("a65536").end(xlup).row
Time Format Like In Access
How can I get my time format in excell to be like it is in access ie. 1:00 Pm. I want to put the time format in my excell spreadsheet and make sure that people enter the time in that format and I dont want to lock the sheet. So is there a way to make certain that the time they put in is the way I want it!! 1:00 PM
Connect To Access Using ODBC
how to do this with Java but not VBA, I have the capability of understanding it I just need to know where to look because I can't seem to find any solid information on the net from my searches. Does anyone have any websites, other threads or anything they could direct me to for this kind of thing.
I was contemplating putting this in the Access thread but I want to connect to Access through Excel so I think it fits both.
My plan is to use a macro to send specific cells to five seperate tables in an Access database using VBA and SQL.
VBA To Query A Access Database
i am trying to use VBA to query a access database that i have i want to be able to pull the information that matchs either textbox4 or 5 i am using the code below but i am getting global errors.
Private Sub CommandButton1_Click()
Dim custname As Variant
Dim Custnum As Variant
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
custname = Range("TextBox5").Text
Custnum = Range("TextBox4").Text
With ActiveSheet.QueryTables.Add(Connection:=Array( _
"ODBC;DSN=Insolvency;Description=Insolvency;APP=Microsoft Office XP;DATABASE=Insolvency;Trusted_Connection=YES"), Destination:=Range("Listbox1"))
.CommandText = Array("SELECT * FROM POST WHERE Customer_Account_Name=" & custname & " AND Customer_Account_Number = '" & Custnum & "' ORDER BY Customer_Account_Number")
.Name = "Insolvency Post Query"..........................
Access To Pop-up Main In Sheet
I created a popup menu when you click the right mouse bhutan .. ok?
Now I would like to access the pop-up Main excel, where you click with the right mouse button and appears Cut, Copy.
then I would like to add a new a item in this pop-up
Access Data Import
I am having some issues importing data from Excel to Access. I am attempting to import about 45000 rows of data from Excel to Access. It appears Access is only importing about 16000 of the 45000 rows. I am using 'import' in 'get external data'.
Connect To Access Database
I was trying to move data from excel to access database in VBA. not sure if this has been done before.
What i have got at the moment is that there are some data in excel spreadsheet that i can dump into the table in the access database. My problem here is i need to be able to open the database first, set up connection, and then perform SQL insert query command.
So in the worksheet, i have a button with the following codes in it
so far i could just manage to open the database as follows