[VBA] Problem Creating An Excel From Access

Apr 7, 2008

Hi All,

I am having real problems creating a Excel from Access. I have rea lots of threads, but none seem to address this problem.

OK, so I have windows XP, Access 2003 and Excel all running quite happily on my PC, when I copy Access databases with the verb ".Excel" in it, I can access it and update/extend as needed.

However, I have just created a new piece of VBA code in a new database and the ".Excel" extensions are not present.....

So I have

Sub openReport()
Dim myXL As Excel.Worksheet
Set myXL = createXlWorksheet
.........
End Sub

Public Function createXlWorksheet() As Excel.Worksheet
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets.Add

Set createXlWorksheet = xlSheet
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing

End Function

And in some databases this works correcttly, but this one database,when I type the string "Dim myXL As.Ex" I do not get the "Excel" operator presented, it is just not in the list of object functions..... any ideas?? it's sending me mad!!!!

Thanks

View Replies


ADVERTISEMENT

Creating Excel Sheet From Access

Sep 30, 2004

I have written a piece of code in Access that creates a Excel work book. The work book is populated with the various data and then made visible to the user.

Everything is working perfectly apart from one minor problem.

When creating a new workbook excel automatically puts 3 worksheets in... If the code creates 1 or 2 sheets of data I want it too delete the sheet that is blank. This is easy to do although it always prompts the user for confirmation.

How do I delete a worksheet without the prompt?

I have hunted everywhere for the answer and can't find it anywhere, any help would be great.

Example of code:


Dim XL As Excel.Application
Dim WkBook As Excel.Workbook
Dim WkSheet As Excel.Worksheet

Set XL = CreateObject("Excel.Application")

Set WkBook = XL.Workbooks.Add

Set WkSheet = WkBook.Worksheets(1)

WkSheet.Delete

View 1 Replies View Related

Should Use Excel Or Access For Creating New Database

Aug 30, 2015

I am new to Access and somewhat OK with Excel.I am working at a government institution, agriculture sector. We have field staff of ~150 doing different field ranges ~350. Some officers are assign to more than one field BUT no field is assign to more than one officer. (these fields belongs to different Districts, number of fields in each district is not the same)

we have four different programs namely new cultivation program (NPP), productivity improvement of existing lands (PIP), farmer capacity building (HRM) and post harvest handling (PHP). Each program has its activities lets say NPP1, NPP2, PIP1, PIP2,PIP3 etc. for an example NPP1 is land inspection, NPP2 is donating planting materials. these activities are predefined and sequential. (planting materials can not be donate without land inspection)

Officers send their progress to progress monitoring unit monthly which includes progress of each program and each activity progress for that month. My objective is to track, analyse, visualize officers progress.

These are the questions I have,As I am OK with Excel and NOT good with Access do you think I should use access for this due to any special advantage only access can give me.can I visualize data with Access?

View 2 Replies View Related

Creating Access Database From Excel Document?

Feb 22, 2015

I have attached the excel document in a zip file. Excel documents are not an authorized file type. This is going to be used for volunteers to input the shift and day they would like to work. I want to start by requiring volunteers to contact me and I will add them to the list of possible volunteers and I will give them a unique identification number.

When they contact me I will require all the information that is currently in the excel document (first, last, supervisor, ph number) I will then add them to a list of possible volunteers.

Then I would like a form they can access via sharepoint for volunteering what shift they can work. On this form it will have a box to input their unique id number and then select a shift from a dropbox (that has not been filled and auto populates). This will add them to the schedule.

Then I need a way to pull a report that shows all the volunteers and does not include their ID numbers.

As you can see the supplied document is full for March. I also have a second sheet that is blank for April.

I imagine there will be tables for

Volunteers (no duplicates in this list)
Supervisors (1 supervisor can be over multiple Volunteers)
Dates/Shifts (there are 2 shifts per day, there are 2 slots per shift)

View 6 Replies View Related

Modules & VBA :: Creating Excel Pivot Chart In Access

Jan 21, 2014

I've written this code in Access to create a pivot chart in Excel. All the code listed is good except for the last line. The last line creates another instance of Excel. I can't figure out what the correct syntax is.

Set xlApp = New Excel.Application
xlApp.Visible = True
Set wb1 = xlApp.Workbooks.Open("c:chi estpivot.xlsx"
wb1.Sheets.Add
wb1.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _

[code]....

View 14 Replies View Related

Creating Access Table Linked To Excel File

May 22, 2013

I am trying to create an access table linked to an excel file.

The excel file has 256,000 kb, 15 columns, 6,400 rows.

When I go to CREATE, DESIGN VIEW in access and try to create the new linked access table i get this message -

"MICROSOFT ACCESS HAS ENCOUNTERED A PROBLEM AND NEEDS TO CLOSE". I click on Ok and then it says "REPAIR MY OPEN DATABASE AND RESTART MS ACCESS".

I click on OK and then save the back up file. The file disappears. I start over again and the same process starts again and again...

View 14 Replies View Related

Need Help Creating Table From Excel File

Nov 20, 2006

I am stuck with a problem where I need to create a new table from an excel file. In detail my problem is;
The excel file contains an order from a customer, like below,
BOM Component Qty
123 abc 2
123 def 2
234 ert 1
234 qwe 1
234 uio 1

I need to create a table from this data like;
Qty Partno
1 123
4 abc
4 def
1 234
2 ert
2 qwe
2 uio

NB! In reality the components are numbers not letters.
The qty for BOM is always 1 and the component 2xqty.

It is important that the BOM number is listed first and thereafter its components.

So I need to somehow associate the BOM number with its components and list them together as a group.
I just cannot figure out how to do this.

ANy help is greatly appreciated.

View 1 Replies View Related

Creating A Table To Export To Excel

Aug 11, 2006

how easy is it to have access create a table and export it to excel, and then have fields on an already made spreadsheet filled in.

View 1 Replies View Related

Creating A Button That Exports To Excel

Oct 5, 2006

Hello All-

I'm at the end of a long project that has one last step. I was hoping that someone here would be generous enough to help. I'm pretty much a novice at Access and am sure that my question can be easily answered. So here is the problem.

I have data that is loaded from a PDA to a form in Access. The data can then be viewed in a list box which is great. I also need to be able to save the data from the list box, using a button, as an excel spreadsheet. Is there anyone here that is willing to guide me to a solution?? Thanks in advance -Tom

View 2 Replies View Related

Forms :: Creating Tab To Get Records From Two Excel Sheets

Nov 30, 2014

I plan to create a tab in access, which has text box and two buttons on it.

when I click the 1st button "Get Me Next" it should get the record from an excel sheet. and when i click the 2nd button "Case Closed". this records should get save in an other excel file.

View 1 Replies View Related

Modules & VBA :: Creating Opening And Put Excel File In Folder

Oct 21, 2013

I have a macro in access that will create a folder and create a word doc in the folder with the name of the folder. I would like to add to the same folder an excel file. The excel file is in a folder and needs to be copied every time in a new folder when created. where to add the excel file from the below folder:

C:Excel CopyCombine_PDF.xls

this is the macro:

Code:

Private Sub Command22_Click() 'this will register the letter and create folder, word doc and open all
Me.[DateRegistered] = Date
Me.[PersonRegister] = Environ("Username")
Me.Refresh

[code]....

View 2 Replies View Related

Modules & VBA :: Creating EXE Or BATCH File That Executes Specific Excel Macro?

Jan 27, 2015

Is there a way to create some sort of an EXE or BATCH file in any Windows Explorer folder, that executes me a specific Excel Macro?

My problem is that I got several files split up by Departments, updated every day.

So far I have to open each file and update the format.

It would make my life much more easier if I could just run a file that opens each file and applies a format to them.

View 1 Replies View Related

Access Query With Links To Excel / Export To XML And Back Into Excel

Apr 25, 2013

I am using Excel and Access 2010.

I have an excel spreadsheet with 8 tabs. They are all in the same format and column order. They are employees grouped by region. My ultimate goal is to merge all of these onto one excel tab, relatively instantly. I created a master tab and tried doing array formulas and Vlookups, it worked but my spreadsheet was way too slow.

My solution? Import and link them to an Access database, step complete. Create an XML export then import into Excel.

My problem? The only way to update the excel tab with the combined tabs is to save the excel file after changes, go back into Access, re-export to XML, then go back into excel and refresh the data.

My questions, is there any way to automate this process to the point that I can change excel, save, then hit refresh on my excel tab with the XML import to auto-update?

View 7 Replies View Related

Reports :: Creating Reports From Imported Excel Sheet

Jul 9, 2013

i have an excel data for assets and i have imported it into access 2010 but i want to be able to do the ffg;

1. want to be able to generate reports like how many computers does a particular branch have.
2. i want to be able to sum the no of each field heading per branch

View 1 Replies View Related

General :: Access Data Export Into Excel As Data Linked To Excel

Oct 21, 2012

how i can export the data from Access to excel using Access VBA for the specified sheet using data linkage with access database. Like we used to do it manually in excel as external data from access.Like we have some codes for linking excel file to database mentioned below;

DoCmd.TransferSpreadsheet acLink, , "region", "F:DB PracticeBook1.xlsx", False, "region"

Can we have something like this to link database table in excel file automatically.So that the excel size won't be that big and also it saves processing time.

View 5 Replies View Related

Importing Excel To Access Keeping Relationships In Access Tables

Sep 13, 2007

I have a stock control database which i have nearly completed. This has Manufacturer, which is linked to products, which is linked to Sub Product(which also has field partCode). i.e. Manufacturer1 can have 3 products, and each of these products could have 5 subsystems and partcodes. Each partcode is unique to that subsystem/product/manufacturer.

I then have a pricing spreadsheet in excel, which has many tabs. A new column has been added for each item for Manufacturer,Product,Subsystem and Partcode.

I need to import these manufacturers,products,subsystems and partcodes, but into the tables with the correct relationships, i.e. product1 and product2 are products of manufacturer1 and so cannot come under manufacturer2, and so on.

I hope this makes sense, Thanks in advance for any help you can give!

Emily

View 14 Replies View Related

Creating Doc From Access

Oct 9, 2006

Hi,

I have created an Access Form wherein i take the user input in various text boxs and text areas.

Now plz help me to find out how to create Microsoft Word Document automatically from the information which the user has submitted.

I have provided a button named submit which when clicked will submit the information into the Access Database and using that data i want to create a Word Document into a particular format.

What is the way in which this could be achieved?

Please help me out to find a solution to this problem.

Thanking you,

with regards,
Kapil

View 12 Replies View Related

New To Access. Need Some Help Creating A Database

Apr 25, 2006

Hello everyone!

I heard from a number of people that this is the place to come for Microsoft Access related help.

So here is my question and I hope someone can help me understand access a little bit better.

I am trying to create a database for a job I am doing. THere are 700+ convenience stores that we (4 inspectors) inspect every three months.

We have been told to do an ADA compliance survey when we visit these stores.

The ADA checklist that we have is about 78 questions and my manager wants me to create an ADA database for this information.

So I am in need of help on how to create a database that allows me to input the answers of this ADA checklist for each store inspected.

I then would like to be able to pull all that information into a report that I could say of the 700+ stores, 50% passed all questions, 25% passed only questions 1-??, etc. etc.

I can upload the two files: The ADA checklist and our Store list if anyone would like to help me out!

Thanks Much!

View 9 Replies View Related

Creating Views In Access?

May 11, 2006

hello :)

how can i create a view in access? is it possible using any of the wizards or can i even use the sql coding feature??

is it possible to grant views to users???

View 2 Replies View Related

Looking For Help Creating Access Tables

Apr 2, 2008

Iam new to access and having problems create database tables and their relationships, from the following details without duplication.

Tape Identification Numberà unique tape identity
Date -à the date the backup is done .
Backup type à either Daily or weekly or monthly or Full System or Yearly or Special
Duration à either automatic or Manual
Technician name à Person performing the Backup
Comment à comments about the Tape’s history
Location à tape is either located onsite or offsite.
Number of use à Number of times the tape has been used
Restoration à tapes restoration Details, either yes/no


Requirements

1.perform backup everyday
2.Perform restoration everyday
3.Search for tape from offsite storage
a.Tape should be located offsite
b.If it was used for daily backup, it should be at least 60 days old from current date.
c.If it was used for Weekly backup, it should be at least 6 months old.
d.If it was used for any other backup type, do not use.

** the database should provide history

View 1 Replies View Related

Creating 4 Fields From 1 In ACCESS

Nov 4, 2004

I am working with some chemical compounds in a database I am building. I grabbed an html file off the web on a listing of chemical compounds...converted it to ascii and imported it into ACCESS. Rather than write a Perl routine I was wondering if anyone out there had some sql code that might handle it. The first 3 records look like this and are contained in one field. I am trying to break this guy into 4 fields.

0001 Acetaldehyde 75-07-0 AB1925000
0002 Acetic acid 64-19-7 AF1225000
003 Acetic annhydride 108-24-7 AK1925000

The fields would be named in order as:
GUIDE 002
CHEMICAL_NAME Acetic acid
CAS_NO 64-19-7
RTECS_NO AF1225000

The first two fields are left justified but the number fields are rather zigzagged throughout.

Anyone have a cure for this beast?
I thank you in advance.

the raven man.

View 8 Replies View Related

Creating ID Number In Access

Mar 1, 2012

at the moment we have been given this problem where we have to incoporate a Dmax function into the following code

IDnumber = Left(Firstname, 3) + Left(Lastname, 2)

from this code the ID number creates something that looks like this

gembl

however i need a four digit number after this ID, for every different ID i need the numbers to increase by one the following code was given to us to do in Got Focus but this did not work

IDnumber = Left(Firstname, 3) + Left(Lastname, 2) + Trim(Str(DMax("right(IDnumber,4)","Customer tbl")+1))

View 3 Replies View Related

Creating MDE File From Access 2003

May 26, 2005

All..
I have an access 2003 application I have front end and back end separately. When I click "Make MDE File" from tools menu, nothing happens.
When checked the Windows Task manager(Windows 2000), CPU usage is 100% and MS ACCESS is not responding. There are no messages.

Anyone experienced this problem ?

Thanks
Bosch

View 3 Replies View Related

Help Creating And Designing An ACCESS Database!!!

Sep 1, 2005

Hi guys, i need help with a sample database, and wondered if anyone could tell me the entities and how to calculate the prices etc. If anyone could attempt starting the database off for me it would be appreciated too!!

Here is the spec!!!

You are required to produce and document a design that meets the requirements of the McDuffs Burgers scenario:

The corporate office of McDuffs Burgers has asked you to design a database to help track its restaurants and managers. The database is to help the management show the total annual sales of each restaurant and the performance of each manager, as measured by the totals annual sales of all restaurants for that particular manager. Each restaurant is supervised by a single manager, but a manager is also responsible for several restaurants. The company stores typical personnel data (name, salary, and so on.) for each manager as well as basic data for each restaurant such as the telephone and address of each restaurant, its size in square metres, and total annual sales for the last fiscal year. The company would also like objective ways to measure the performance of a manager such as the total revenue for which they are responsible, the average annual revenue per restaurant, the average annual revenue per square foot, etc.

The database should also track the orders that are placed by individual restaurants to the corporate office for various food supplies. Each order is associated with a specific restaurant, and of course, a single restaurant will place multiple orders during the course of a year. The company uses a standard set of product numbers, product descriptions, and associated prices that applies to all restaurants. Each order can specify several products, and a single product may appear in several orders. The database should be capable of computing the total cost for each order.

Deliverables
1. Entity definition for each entity.
2. Entity Relationship Diagram, which must show entities, relationships and membership.
3. Relationship definition for each relationship.
4. Relations (This must include for each relation the primary and foreign keys).
5. Data Dictionary.



Furthermore:

You are required to implement the design (produced in the first part of the assessment - McDuffs Burgers - Database Design), by designing and creating queries, forms, reports and any supporting code. Revisions may be made to the design in the implementation process.

You should note the management of McDuffs Burgers has little experience of database systems and wish to be advised on the information the system can produce.

They require example reports demonstrating the capabilities of the system to:
- Aid the day to day operation of the business.
- Provide appropriate management information.

You must also implement an appropriate user interface to the database easy to use.

View 5 Replies View Related

Creating Jobs Using Scheduler In Access

Aug 7, 2006

Does anybody know how to schedule in access like sql. Like a "job" in sql server?

View 14 Replies View Related

Creating A Data Access Page

Aug 8, 2006

I am trying to make a DAP for data input into a table.

I used the wizard and it has the fields I want, I can scroll through them and view the entries, but they are not editable.

I read about changing the Page DataEntry property to True, but I still cannot select any of the editboxes on the DAP and now the DAP just shows blank non-selectable editboxes.

I decided to create a dummy table to work with to test creating a DAP, my dummy table looks like this:

Group Name Number Text
1 Bill 3 pink
1 Adam 5 green
2 Charlie 7 blue

I ran the wizard on the above table and again I can scroll through but not select any of the fields, and with DataEntry set to True I still cannot select/edit the textboxes.

Is there something else I need to do to be able to make an input form?


Once I get that sorted out I have a followup question: The dummy table above is where the input data goes, but on the input form I would like if possible to get the Group and Name from a different table using drop-lists. The real table has over 5000 names split into groups of about 30-50 so picking a group first would help find a name in the list which will eventually be input to the table above.

Hope that all makes sense, and thanks in advance for any help!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved