Just learning, need to have Access open an excel file

sondriven

Registered User.
Local time
Today, 08:27
Joined
Jun 13, 2002
Messages
158
Hello, My first post here.

What I want is for Access 2000 to open up a Excel file, but not have excel open up seperately.

I created a Macro RunApp and had it linked to the file but it opens up Excel seperately, so thats where Im at.

Ive seen this is possible but dont know how to do it. If someone could give me a clear step-by-step it would be appreciated.

Thanks.
 
Hi, is this possible? Or am I wasting time? I could use some insight on where to go for help with it. I worked on it all day yesterday and am starting to curse the screen repeatedly.

Thanks.

john
 
John,

Don't fret...with a little extra information, you should be on your way. I would like to know what you are trying to do exactly.

Are you trying to use Excel in a Form....or Report?

Are you trying to display an existing chart or worksheet?

Do you want to have the ability to edit the Excel chart from Access?

Things like that are important in determining the approach you will need to take. Also, why are you concerned about Excel opening? Is this a problem. If you don't want Excel to open you should consider inserting the Excel chart or worksheet as an object (linked if it is dynamic).
 
Based on my limited understanding of the vagaries of MS Office, you ask the nearly impossible - unless you are willing to write a LOT of VBA code. And even then, if you take a "traditional" approach, you will open up Excel.

I must ask you why you don't want to open Excel.

Is it that you don't want to SEE Excel? Or that you really don't want to OPEN Excel at all for reasons such as memory or some sort of system resource problem.

If you attempt to use a Macro, you implicitly open Excel. If you use the Application Object approach, you will open Excel. But at least in the latter case you could make it invisible.

If you really want to open the file without opening Excel at all, you will have to hope that someone can point you to a document laying out the internal structure of a WorkBook file.

If you just don't want Excel to be visible, I think several of us can help you with that.
 
Thanks for the replies

Heres my objectives:

To have an excel spreadsheet inside of my Access database. The spreadsheet will work like a worksheet where people will enter in data and spit out a chart with all the visual data.

The main reason for having Excel inside of Access is for it to be as neat and clean as possible. I understand Excel needs to open but I dont want to see it that way, so I guess my question should be how do I hide it.

Once again, thank you for the help.

john;)
 
Why don't you just link the spreadsheet to Access as a table.

With a linked sheet you the data will be updated in the Access table when you enter data in excel or if you enter into the table, your excel sheet will be updated (does not have to be open at the time).

Explain the process a little more, there are many different ways to work with Excel from access, it just depends on what will be you are trying to achieve. Would a simple hyperlink to the file, serve the purpose?

Ziggy
 
I tried to import the Excel file into Access but I received 2 errors in the form of tables. Im figuring something isnt working with that.

A hyperlink works, but Im trying to make Excel invisible. I maybe just stuck with how I have it now.

Thanks for the inputs.

john
 
OK, this is getting clearer now.

The most likely reason you can't import directly is because you have a field formatting problem in the spreadsheet. I'll explain in better detail so you know for what you are looking.

When you import a spreadsheet you usually use the Import Wizard to do it. But he's only a minor-league wizard. If the first data row contains something that is numeric in a given column but a later row is alphanumeric, it is too late. The die has been cast and the wizard already has assumed a numeric column.

One way around this applies if the same spreadsheet format is always going to be used regardless of who uses it. You could in that case define a holding table that contains the correct field formats for every field. Then import your spreadsheet to the existing table. When doing so, SAVE THE IMPORT SPECS with a nice name you can remember. Then set it up so that if you activate a macro (directly or with some VBA code), the macro action names the import specs. That way, when you repeat the process, Access knows a lot more about the file's format and can deal with it better.

Next, write a query that reads the imported spreadsheet and appends the entries to the REAL table. This allows for format and size changes as required. You can also do filtration of bad data before or during the import if you wish.

But now I have another question:

Why are you using a spreadsheet? (Yes, I know you answered this - but I am going to propose an alternative...). You said you wanted this as an object inside your database. From this I draw the implication that the database will be shared in some way. In other words, your users will be opening Access first, not Excel. I will point out that even if Excel was present as an OLE item, it would open and would, for all intents and purposes, be Excel. I.e. you can do anything in Excel without regard to formatting.

Surely you cannot suggest that you want your users to be able to enter arbitrary formulas during data entry! Surely you cannot suggest that you want your users to be able to enter text where numbers should be! Surely you cannot suggest that you want your users to be able to enter data in cell AZ5315 (or some other arbitrary way-out location.) That way leads to chaos.

My alternative: Consider building a separate "import" table and use the FORM WIZARD to build you a pretty little data entry form based on that table. This is not a difficult task and it prevents certain classes of data problem right off the bat. It also doesn't open Excel at all! Even for computers with resource limits, this is much easier to handle than having Access and Excel open at the same time.

Build the form as I described. If the underlying table's data types are correct, Access will flag the input data format errors for you automatically. Then, as you gain experience in Access, you can apply all sorts of validation rules in the data entry form. And by using this separate table as a staging area, YOU get the chance to filter out bad data before it makes its way into your main table.

So I repeat my question: Why are you so fixated on using a spreadsheet?
 
Just curious...it sounds like Access created 2 tables with "IMPORT Errors", but ussually when that happens your table still imports. Check the "Error" tables and see if you actually lost anything worthwhile.

It could be garbage that Access has rejected, or sometimes you need to allow an "ID" field (access choose primary key) if you have duplicate data.


Zig
 

Users who are viewing this thread

Back
Top Bottom