Access Another Program Via Excel VBA?
May 22, 2012
I am trying to access another program via Excel VBA. The idea is that, we fill out out time and attendance sheets for work on excel workbooks. But, we have to go into a terminal program to enter this information so it can be uploaded to whereever it goes.
I am able to get the Shell command to work. But, it will be riddled with sendkeys commands and application.wait. I am sure that this is not the best way to program something like this. I believe I read that for this to work that it has to be COM compliant. I don't know. The program is a Java based terminal program.
This works for me
Code:
ShellExecute 1, "Open", "C:UsersPublic******lib***_core.jar"
But this does not
Code:
CreateObject "C:UsersPublic******lib***_core.jar"
It gives me a Run-time error 429, ActiveX component can't create object.
View 1 Replies
ADVERTISEMENT
Oct 20, 2008
I start my excel program from a "Shortcut" in "Folder 1".
That shortcut points an Excel program in "Folder 2".
When Excel is started,
Parent.Path returns "Folder 2",
but I really need to know what "Folder 1" was.
It seems that should be available as
when I do "Save File As"
it is pointing to "Folder 1".
Is there a way to find what "Folder 1" really was from the VBA enviornment.
View 9 Replies
View Related
Jul 28, 2008
i am creating a break track program using excel with vba. My excel file contains the data for all employees. I have a Userform where the user will enter his employee ID which will pull up his data. I have 3 option button in which the user choose what time he would start his break. Once the user click the start button, the time he started his break will be placed in a cell and a dialog box will appear stating the time the user needs to be back. Once the user click the end button, the time he ended his break will be place on a cell as well and then it will show a message "on time" if the user came on time else if the user was overbreak, the overbreak amount of time will be displayed. I have attached my sample file together with some vba code.
View 3 Replies
View Related
Jan 5, 2006
I imported data from another program to Excel, it is an address database. Some of the entries are all capital, some are all lowercase, some are proper. I would like to switch everything to proper. I have tried numberous times to do EXACTLY what I am reading about copy and pasting, entering the formula, designating the cells I want it to apply to. However, when I do it, nothing changes.
View 9 Replies
View Related
Jan 25, 2013
For the last half dozen years I have been using a simple Excel table to sort Christmas mix cds. The headings are: song, artist, album, year, and songwriter. This year after adding the additions, I tried to sort and it would not work. The automatic sort stopped at the end of the previous years' work and did not pick up the additions. When I try to include this year's additions, the sort grays out. I'm sure it's something simple. Adding additions to my brother's and daughter's lists worked fine.
View 5 Replies
View Related
Jun 3, 2009
Trying to program cell C1:
If A1 is between .81 and 3, AND if B1 is Adult, then C1 is Priority Mail
If A1 is greater than 3, AND if B1 is Adult, then C1 is FedEx Ground
If A1 is Less than .81, AND if B1 is Adult, then C1 is First Class Mail
If A1 is Less than .81, AND if B1 is Child, then C1 is Hold for Inspection
etc.
There will be a list of ~45 conditions that will populate a specific value in C1. Can this be done? If so, how?
View 6 Replies
View Related
May 28, 2014
I am currently looking for a front end program to access multiple excel files at once. In a nutshell, I work for a company that uses subcontractors. Each subcontractor is graded in about 7 different performance categories. I receive daily excel files that give us the results for each category. I get separate files for each category.
What I do right now is use a master excel file. Every day I take each file I receive from our parent company and add it to the master file. I have a huge excel file that has a separate tab for each performance category. Then I have a "Report" tab where I use various formulas to summarize a sub's performance over a certain date range.
Essentially, the report tab is just a neat and concise way to display the stats of an individual sub, an office, a region or the whole company. I use tons of VLOOKUP and COUNTIF(S) formulas to look over the hundreds of lines of data and bring back the stats. It works but it is just not very efficient as I get hundreds of new lines of data every day.
View 4 Replies
View Related
Nov 12, 2011
I have two work sheets where I have data.
Sheet1 contain daily input table which as follows:
Code:
Namesalary Bonus Check
XX1000 2 FN
XY900 1 NA
YY1100 2 FN
ZY1500 3 DP
ZZ1250 2 FN
AA1050 2 NA
AZ 950 1 FN
Sheet2 have table where all the information is saved. So we can say this is database of sheet1. Which store every day information of sheet 1.
Code:
SALARY DATABASE
Name SalaryBonus
What I want to do is that ---it copy all the data which fullfile condition FN and move to the Sheet 2 which is salary database. Two important things to check is that. IF name already exists in the sheet 2 then it replace old info with the new one. Second thing is to sort the whole table(Salary database-sheet 2) according to A-Z (Name column). I use office 2003. I hope I provide all the information.
View 9 Replies
View Related
Jul 3, 2014
However, I have got an Excel file which contains a lot of information. There are four sheets with large Pivot Tables.
But the thing is, the plan is to do the tables much larger, create tables which more specifically shows information. When doing so, the tables will show much more information, and therefore be much larger. It will be difficult to read and understand the tables because of the large amount of information.
What I want is to store information in, for example, another program such as Microsoft Access. There, I can put a huge amount of information and then link it to Excel, so that in Excel I only see the Access stored information when I "search" for it with y created slicers. Like, when I use my slicers and click on one category it sort out and shows me the information i want, even though it's stored in Access. It only shows it in Excel when I "ask" for it. This is what I have thought.
View 6 Replies
View Related
Sep 25, 2012
I have an Excel 2003 list with four columns as shown below:
Zipcode
CRRT
Count
Bundles
85710
C004
693
14
85710
C005
867
18
85710
C006
1021
21
I want to "expand" this list to use in a Mail Merge program to produce tags for our direct mailing. Each bundle contains 50 letters, so in the first line on the above spreadsheet, there will be 13 bundles of 50 and 1 of 43. Currently, I can cut and paste to create the following table, but there has to be an easier way...
Zipcode
CRRT
Count
bcount
Bundle
ibundle
85710
C004
693
50
1
14
[Code] ........
So as I pull this into a mail merge I will get a tag that shows the zipcode, the crrt, the total pieces for that crrt, then number of the bundle for example " 1 of 14" and the quantity in that bundle, for example "50 of 693", then the next bundle tag will print, 3 to a page. I know that here has to be an easier way either in the mail merging process itself or with EXCEL? Am even open to build these with ACCESS to create the tags. The beginning database contains anywhere from 350 to 800 lines of original data, so as you can see the cut and paste is VERY time consuming.
View 6 Replies
View Related
May 14, 2007
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.
View 10 Replies
View Related
Dec 18, 2007
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.
View 9 Replies
View Related
Jan 16, 2012
I have an excel file which is shared by multiple users. I would like to make one person to have read,write or edit permissions and rest of the users to have only read only permissions.
View 1 Replies
View Related
Dec 16, 2013
I'm running an Excel program such that the user inputs a variable. The program opens an Access database which is linked to the Excel sheet where the variable is stored. Access then runs macros containing queries based on that variable. I've noticed that the link to Excel is slowing performance and I'd like to speed things up, some code that would allow me to plug the variable into Access for use in the query without having to link to the Excel workbook.
This is a piece of the code I use in Excel which runs the Access macro:
Code:
For iter = 1 To bottom_row - 1
If IsEmpty(MyMacro(iter)) = False Then
Set AccessApp = CreateObject("Access.Application")
With AccessApp
[Code].....
Everything works well as-is; it's just slower than I'd like. Due to other constraints I'd rather not go into here, I really am forced to use this kind of Excel/Access interaction. In other words, the user must use Excel to run an Access query.
View 5 Replies
View Related
Feb 17, 2014
I am trying to import database records into Excel, but i keep getting an error "run-time error 424" on the code below.
It is probably something simple, but i havent tried importing from Access to Excel before.
The code below should clear the data from "Existing" and then copy the data from test.mdb into the same sheet.
The error occurs when opening "Data Source"
Code:
Private Sub Workbook_Open()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim dbCommand As New ADODB.Command
RowCount = Worksheets("Existing").Range("A" & Rows.Count).End(xlUp).Row
Worksheets("Existing").Range("A2:V" & RowCount).ClearContents
[code]....
View 9 Replies
View Related
Jun 29, 2007
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
Application.ActivateMicrosoftApp xlMicrosoftAccess
'Runs the macro "Sample AutoExec" from the NWIND.MDB file
Application.DDEExecute Chan, "ImportData"...........
View 9 Replies
View Related
Dec 17, 2008
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?
View 9 Replies
View Related
Jun 17, 2014
I have an acess database where I export the data into a blank excel workbook and then copy and paste the data into a report file. My goal is to automate this process and my first thought was to add a button into the access database and have it export to an excel template, but using/editing the access database is not an option, so, that leaves me thinking about automating this process from excel. Is it possible to export data from an access database into cell A1 of a tab?
View 5 Replies
View Related
Mar 12, 2014
I have created one Info path solution to gather information from different locations to one hidden Access database. And in last month or two I already have more than 30 000 entries in database. On other side I have created 2 excel workbooks, one for purpose of report that has all connection done through VBA, user just opens it, clicks button and gets report and one workbook that is for other set of users so they can change 2 specific columns of data, everything else is locked. When one department fills value it should fill based on gathered information, and clicks save that cell or cells are being locked.
At first I did on worksheet change event, when user changes a cell (enters information) it triggers worksheet_change event and saves that value in database and colours cell green. But, then users start complaining that when they use copy paste or the use fill paste option (just pull value from one cell to others) it does not save value. Ok ... that is because worksheet_change event does not trigger in situation when copy paste in any form occurs.
So how to solve it ... when pulling data in excel I pull identical table (data) in other hidden worksheet. When they change what they need to change, they click button "save to database" i have created and there is a macro that makes other sheet visible, goes through the records and saves where cell value in table that is being entered is different then same cell in hidden table.
Problem is that sometimes my code works without a problem and sometimes they get an error. I cannot figure out when. When a lot of users use that excel file, for some users it is a read only file, and as I presume that is ok, because macro works in any case and data are stores in database so excel file itself does not have to be saved.
Here is code.
[Code] .....
View 1 Replies
View Related
Dec 1, 2011
I know that I can import data from access into excel. What I am looking for is a way to have the data linked so that any time that a change is made in access, that change will be reflected on my Excel worksheet.
View 1 Replies
View Related
Feb 14, 2012
I have about 180 Excel files (each one with 51 columns and around 30,000 rows) that need to be exported to an Access table.I'm using the routine below which is extremely time-consuming. I'm sure there is a better way to export an excel file to an Access table.
Sub ExportHistData()
Dim rst As Object
Dim cn As Object
Dim i As Long
Dim lstCell As Long
Application.ScreenUpdating = False
lstCell = [a65536].End(xlUp).Row
If lstCell = 1 Then Exit Sub
[code].....
View 4 Replies
View Related
Mar 12, 2012
I have the below code that will do a data dump of an access table into excel based on an SQL query, is there a way to do a select statement that can match against the data in column C on the spreadsheet.
like:
"Select * From Bsmart where Serial_Number = ##[EXCEL COLUMN C1:Lastrow]##
Code:
Dim bkNew As Workbook
Dim cnt As ADODB.Connection
Dim rst As ADODB.Recordset
Dim stCon As String
Dim SQl1, SQL2, SQL3, SQL4, SQL5, varSQl As String
stCon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
[Code] .....
View 1 Replies
View Related
Mar 27, 2012
I am creating a Payroll Database. It is nearly complete except for the federal and state withholding tax data. I want my db to look up the data which I have saved in an excel workbook. I need the lookup to be for marital status and # of exemptions. There are a total of two variables for each table. 1. How much the gross pay is (ex. between $175-185) and # of exemptions (ex. 3 exemptions).
View 2 Replies
View Related
May 24, 2012
I currently use a function very similar to this one with a SELECT query to return a field to excel. I have modified this into an UPDATE query to update a field.
I am getting errors at this point:
Code:
If adoRS.BOF And adoRS.EOF Then
DBNoteUpdate = "Value not Found"
Else
DBNoteUpdate = "Action Confirmation"
I believe this area of code was to trap the error that occurs when the lookup field name was not found in the table. I left it in because I still want to trap if the record I am trying to update is not found in the table.
Here is the full code:
Code:
Public Function DBNoteUpdate(RecordNumber As String, _
UpdateTableName As String, _
UpdateNote As String) As Variant
Dim adoRS As ADODB.Recordset
If adoCN Is Nothing Then SetUpConnection
[code].....
The code does work, in that the record is being sucessfully updated by the SQL statement, but its erroring at the point I described above with the error:
Code:
Runtime Error '3704':
Operation is not allowed when the object is closed.
how 'adoRS' is closed at that point because the call to close is right at the end of the function?
View 8 Replies
View Related
Jul 19, 2012
I have an access database that runs some excel subs. If the excel sub doesn't meet a certain criteria, I want to close the excel workbook and close the access database. Most google searches yield how to close excel from access but I need closing access from excel. I was thinking that if the "detonate" criteria was met, I could pass a variable over to access and terminate that way....
If x 5 then
thisworkbook.close
myaccess.accdb.close
end if
or
if x 5 then
appAccess.application.run "Self-Detonate"
thisworkbook.close
end if
View 1 Replies
View Related
Aug 25, 2012
I want to transfer data from excel to access using vba, where 1) I have excel sheet with Header at top row and some data below it. 2) Once I run my macro access table will get created and My excel header row will be my access field names and data will be accordingly.
View 1 Replies
View Related
Dec 9, 2012
I am doing data entry spreadsheet here where the information gets manually input into a spreadsheet and then when the user clicks a button, it transfers it to a the Access database.
This was done by my predecessor but i had to modify it which has now given me a "Run-time error '3061', Too few parameters. Expected 1".
My code is below:
Private Sub SaveandExport_Click()
Dim db As Access.Application
Dim TB As DAO.Database
Dim Intro As String
Dim Tabelle, GName, VarList, TaName
Dim i As Integer
Set db = CreateObject("Access.Application") ' create Access object
[code]...
View 1 Replies
View Related
Apr 7, 2013
I have an excel macro that works of off data that we pull from an access database and the only part being done manually is editing the query and importing the data to excel
What I would like is something in excel VBA that pulls the data from access. my thought is in access i would have a basic query that has the fields we need and excel would have a form to filter those fields as needed.
One of the fields is Date and another Location where we filter date ranges and locations. we currently go in to the query and filter the date range by hand and the locations we want by hand.
I am not that great in access so have not created any macros to pull the data from excel before so don't know what I am doing.
View 1 Replies
View Related
May 3, 2013
I have a procedure in Access, MySub, stored in Module1.
To call it from Excel, I use the following:
Code:
Dim AccessApp As Access.Application
Set AccessApp = New Access.Application
With AccessApp
.OpenCurrentDatabase Filepath:="C:My location", Exclusive:=True
.Run Procedure:="MySub"
End With
Supposing for argument sake, there is another procedure also called MySub saved in Module2 in Access.
The above code will no longer work as it won't know which MySub to call.
How can I specify the correct one to choose? Of course I can rename the procedure in Module2 to something else.
View 4 Replies
View Related
May 18, 2013
I currently have a workbook that has VBA functions that calculates values by looping through large amounts of data in a few large excel sheets. I want to transfer the data from these sheets into Access and then bring data into the VBA code via an array from the data in Access rather than the array being populated from the data in excel as it currently is. How to create the connection. The access DB will be situated in a public directory on a server. How to create the connection string and then how I call the data from Access? I have just downloaded Office 2013.
View 9 Replies
View Related