Import data from Access to Excel containing VB code

Hi!
I am trying to import data from an Access database to an Excel
spreadsheet. I have imported several queries from Access into Excel
already. However the last piece of data that I am wanting to import
into Excel has VB code in the query doing a calculation automatically.
So when I go to Excel to import that piece of data, those queries that
contain the VB code don't even show up as import-able. Is there a way
to import these queries from access into my excel worksheet? I am
using Access 2003 and running on an XP OS. Is it possible to do it in
Excel 2007 if not available in Excel 2003?

I've asked in the Access group and they have sent me here. See below.

Thank you!


On Jan 4, 10:04 pm, "Arvin Meyer [MVP]" <arv...@mvps.invalid> wrote:


> I did venture that it is possible to export the query from Access to
> Excel.
> The query engine uses the Access Expression Service and the Jet Expression
> Service to evaluate the function (VBA code). That wouldn't be running
> unless
> Access is running. While I'm fairly certain you can export from Access,
> the
> only chance there is for an import is to run Access from Excel via
> automation and VBA code.
> --
> Arvin Meyer, MCP,
> MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmv...


Thank you. Is there a knowledge base or a link that you could provide
that might have a sample of what kind of VB code would be needed in
order to run from Excel?

Thanks for your expertise!


I can point you to Access automation articles, but I'm sure that
asking in
an Excel newsgroup should be productive.

0
1/6/2009 3:06:50 PM
excel 39879 articles. 2 followers. Follow

3 Replies
804 Views

Similar Articles

[PageSpeed] 51

Hi,

You can't access them because they need to run in Access to execute the 
Access VBA.  Using 2007 will not make a difference.  One solution is to make 
the Access query a Make Table query and run it in Access.  The resulting 
table will be accessible to Excel.

Another solution you might consider is doing the calculation in Excel or 
writing VBA code to pull the data into Excel and in the code launch an 
instance of Access....

If this helps, please click the Yes button.

Cheers,
Shane Devenshire

<jaclyn.gifford@gmail.com> wrote in message 
news:045a4907-ceea-4422-96d8-aeff1e22b29b@k36g2000pri.googlegroups.com...
> Hi!
> I am trying to import data from an Access database to an Excel
> spreadsheet. I have imported several queries from Access into Excel
> already. However the last piece of data that I am wanting to import
> into Excel has VB code in the query doing a calculation automatically.
> So when I go to Excel to import that piece of data, those queries that
> contain the VB code don't even show up as import-able. Is there a way
> to import these queries from access into my excel worksheet? I am
> using Access 2003 and running on an XP OS. Is it possible to do it in
> Excel 2007 if not available in Excel 2003?
>
> I've asked in the Access group and they have sent me here. See below.
>
> Thank you!
>
>
> On Jan 4, 10:04 pm, "Arvin Meyer [MVP]" <arv...@mvps.invalid> wrote:
>
>
>> I did venture that it is possible to export the query from Access to
>> Excel.
>> The query engine uses the Access Expression Service and the Jet 
>> Expression
>> Service to evaluate the function (VBA code). That wouldn't be running
>> unless
>> Access is running. While I'm fairly certain you can export from Access,
>> the
>> only chance there is for an import is to run Access from Excel via
>> automation and VBA code.
>> --
>> Arvin Meyer, MCP,
>> MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmv...
>
>
> Thank you. Is there a knowledge base or a link that you could provide
> that might have a sample of what kind of VB code would be needed in
> order to run from Excel?
>
> Thanks for your expertise!
>
>
> I can point you to Access automation articles, but I'm sure that
> asking in
> an Excel newsgroup should be productive.
> 
0
1/6/2009 11:37:46 PM
On Jan 6, 5:37=A0pm, "Shane Devenshire" <shanedevensh...@sbcglobal.net>
wrote:
> Hi,
>
> You can't access them because they need to run in Access to execute the
> Access VBA. =A0Using 2007 will not make a difference. =A0One solution is =
to make
> the Access query a Make Table query and run it in Access. =A0The resultin=
g
> table will be accessible to Excel.
>
> Another solution you might consider is doing the calculation in Excel or
> writing VBA code to pull the data into Excel and in the code launch an
> instance of Access....
>
> If this helps, please click the Yes button.
>
> Cheers,
> Shane Devenshire
>
> <jaclyn.giff...@gmail.com> wrote in message
>
> news:045a4907-ceea-4422-96d8-aeff1e22b29b@k36g2000pri.googlegroups.com...
>
>
>
> > Hi!
> > I am trying to import data from an Access database to an Excel
> > spreadsheet. I have imported several queries from Access into Excel
> > already. However the last piece of data that I am wanting to import
> > into Excel has VB code in the query doing a calculation automatically.
> > So when I go to Excel to import that piece of data, those queries that
> > contain the VB code don't even show up as import-able. Is there a way
> > to import these queries from access into my excel worksheet? I am
> > using Access 2003 and running on an XP OS. Is it possible to do it in
> > Excel 2007 if not available in Excel 2003?
>
> > I've asked in the Access group and they have sent me here. See below.
>
> > Thank you!
>
> > On Jan 4, 10:04 pm, "Arvin Meyer [MVP]" <arv...@mvps.invalid> wrote:
>
> >> I did venture that it is possible to export the query from Access to
> >> Excel.
> >> The query engine uses the Access Expression Service and the Jet
> >> Expression
> >> Service to evaluate the function (VBA code). That wouldn't be running
> >> unless
> >> Access is running. While I'm fairly certain you can export from Access=
,
> >> the
> >> only chance there is for an import is to run Access from Excel via
> >> automation and VBA code.
> >> --
> >> Arvin Meyer, MCP,
> >> MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.access=
mv...
>
> > Thank you. Is there a knowledge base or a link that you could provide
> > that might have a sample of what kind of VB code would be needed in
> > order to run from Excel?
>
> > Thanks for your expertise!
>
> > I can point you to Access automation articles, but I'm sure that
> > asking in
> > an Excel newsgroup should be productive.- Hide quoted text -
>
> - Show quoted text -

Thank you! I used the make-table option in order to import the data
into Excel. However, the data is statistics for each end of the month.
So I would like the user to only have to refresh all data from Excel.
But because it is a Make-table instead of a query, it doesn't
automatically update. Is there code or another way to run the make
table-query automatically? Or a way to update all the information
including the make table by running a macro every time the user opens
the Excel file?

Thank you
0
1/7/2009 3:16:29 PM
On Jan 7, 9:16=A0am, jaclyn.giff...@gmail.com wrote:
> On Jan 6, 5:37=A0pm, "Shane Devenshire" <shanedevensh...@sbcglobal.net>
> wrote:
>
>
>
>
>
> > Hi,
>
> > You can't access them because they need to run in Access to execute the
> > Access VBA. =A0Using 2007 will not make a difference. =A0One solution i=
s to make
> > the Access query a Make Table query and run it in Access. =A0The result=
ing
> > table will be accessible to Excel.
>
> > Another solution you might consider is doing the calculation in Excel o=
r
> > writing VBA code to pull the data into Excel and in the code launch an
> > instance of Access....
>
> > If this helps, please click the Yes button.
>
> > Cheers,
> > Shane Devenshire
>
> > <jaclyn.giff...@gmail.com> wrote in message
>
> >news:045a4907-ceea-4422-96d8-aeff1e22b29b@k36g2000pri.googlegroups.com..=
..
>
> > > Hi!
> > > I am trying to import data from an Access database to an Excel
> > > spreadsheet. I have imported several queries from Access into Excel
> > > already. However the last piece of data that I am wanting to import
> > > into Excel has VB code in the query doing a calculation automatically=
..
> > > So when I go to Excel to import that piece of data, those queries tha=
t
> > > contain the VB code don't even show up as import-able. Is there a way
> > > to import these queries from access into my excel worksheet? I am
> > > using Access 2003 and running on an XP OS. Is it possible to do it in
> > > Excel 2007 if not available in Excel 2003?
>
> > > I've asked in the Access group and they have sent me here. See below.
>
> > > Thank you!
>
> > > On Jan 4, 10:04 pm, "Arvin Meyer [MVP]" <arv...@mvps.invalid> wrote:
>
> > >> I did venture that it is possible to export the query from Access to
> > >> Excel.
> > >> The query engine uses the Access Expression Service and the Jet
> > >> Expression
> > >> Service to evaluate the function (VBA code). That wouldn't be runnin=
g
> > >> unless
> > >> Access is running. While I'm fairly certain you can export from Acce=
ss,
> > >> the
> > >> only chance there is for an import is to run Access from Excel via
> > >> automation and VBA code.
> > >> --
> > >> Arvin Meyer, MCP,
> > >> MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.acce=
ssmv...
>
> > > Thank you. Is there a knowledge base or a link that you could provide
> > > that might have a sample of what kind of VB code would be needed in
> > > order to run from Excel?
>
> > > Thanks for your expertise!
>
> > > I can point you to Access automation articles, but I'm sure that
> > > asking in
> > > an Excel newsgroup should be productive.- Hide quoted text -
>
> > - Show quoted text -
>
> Thank you! I used the make-table option in order to import the data
> into Excel. However, the data is statistics for each end of the month.
> So I would like the user to only have to refresh all data from Excel.
> But because it is a Make-table instead of a query, it doesn't
> automatically update. Is there code or another way to run the make
> table-query automatically? Or a way to update all the information
> including the make table by running a macro every time the user opens
> the Excel file?
>
> Thank you- Hide quoted text -
>
> - Show quoted text -

I still haven't found a good way around this. Can someone help me?

I used the make-table option in order to import the data into Excel.
However, the data is statistics for each end of the month.  So I would
like the user to only have to refresh all data from Excel. But because
it is a Make-table instead of a query, it doesn't automatically
update. Is there code or another way to run the make table-query
automatically? Or a way to update all the information including the
make table by running a macro every time the user opens the Excel file?
0
1/13/2009 4:05:15 PM
Reply:

Similar Artilces:

Transferring Data With XML?
I'm new at this. What would be the best way to transfer data in XML format from sql server A to remote sql server B? We would like to encrypt the data with ssl which we already have installed on our iis server. -- .. http://sf-f.org, weblog and search engine for fans and writers of speculative fiction. .. ...

Importing data
When I import sales data through 3CDaemon, I get cells that I of data that I cannot use in formulas. It is like they are corrupted. But can copy the info from cell to cell, just cannot use in formula (ex. =if(dd04="N",1,0. Formula does not error out, but it makes no difference if N, U, or anything else is in dd04. It answers back 0. How can I fix this ? Just a couple of guesses (I have no idea what 3CDaemon is). First, Get a copy of Chip Pearson's CellView Addin so that you can really determine what's in DD04): http://www.cpearson.com/excel/CellView.htm Second, ...

Remote VPN access to Exchange
We have a user who is remotely connecting to our network via VPN through a Cisco PIX firewall. She can access network resources no problem, but when she tries to configure Outlook using our Exchange server, it keeps asking for authentication. Using her windows account information does not work. How do we get past this? Thanks. Is she actually authenicating in the domain or is she using cached credentials? It seems unusual that authentication would work for network resources for not for Exchange. What type of network resources is she asking and is she actually logging onto the domain...

Importing messages #6
I have a backup disk that I would like to impport from, but obviously I do not know how. When I double-click a message, it does not recognize which program to use to open it and takes me to an MS site. All of these have a ..dbx extension. Thank you. "Jennifer" <Jennifer@discussions.microsoft.com> wrote in message news:3398C3D3-FDD8-41CB-8F73-C445B56F6CF7@microsoft.com... >I have a backup disk that I would like to impport from, but obviously I do > not know how. When I double-click a message, it does not recognize which > program to use to open it and takes me...

Import and export
Trying to salvage my data and it was suggestd I import and export files, do I need to import and export closed accounts as well? Only if you want them in the new file. In order to export a closed account, you'll need to first specify that it is open in Money. "Mike" <anonymous@discussions.microsoft.com> wrote in message news:269701c3fc78$9f29fcf0$a301280a@phx.gbl... > Trying to salvage my data and it was suggestd I import and > export files, do I need to import and export closed > accounts as well? ...

Run excel when logged off.
Is it possible to run excel when I'm logged of the computer? I have a excel document that launches a bunch of macros. I would like to have task scheduler run it at night without me being logged in. Is that possible? Thanks, Jasper What happens when you try? Of course if you try accessing "mapped drives", you will have to fix that issue too. Jaz wrote: > Is it possible to run excel when I'm logged of the computer? > > I have a excel document that launches a bunch of macros. I would like to > have task scheduler run it at night without me being logged in...

Can I export from Excel to ACT
I have a huge contact list on an Excel spreadsheet and I was hoping I would be able to export it straight into my Act contact manager. Anyhelp would be greatly appreciated. Thanks Parm, Look at the ways Excel can save, and compare with what ACT can take as input. In Excel, do File - Save as, and go through the formats shown in the "Save as type" box. See which, if any, Act can open or import. The csv would seem a likely one. Or txt. -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Parm" <Parm@discuss...

transfer data in excel between sheets
What I am looking to do is get a function button (or similar) on sheet 1 that can recognise the data put in a column and upon a click of a button transfer data held in a certain cell elsewhere and the date onto sheet 2. If this is not possible, what the whole purpose I am trying to do is on sheet one have a=50 fields per day, where 3 figures are entered per line, 50 lines (ie 150 pieces of data per day) which calculates the average of the 3 numbers per row, and then the average of all these numbers appears in a seperate field on the spreadsheet (this I have already achieved.) Then this...

Import TransferIN into TransferOUT... its possible?
Hi, I have RMS 1.3, its possible to import a transfer in of one store into transfer out on my store? Thanks in advance. Aldo, If you are running HQ, it does this for you, on the next connect to HQ. -- * Get Secure! - www.microsoft.com/security You must be using Outlook Express or some other type of newsgroup reader to see and download the file attachment. If you are not using a reader, follow the link below to setup Outlook Express. Click on "Open with newsreader" under the MS Retail Management System on the right. http://tinyurl.com/75bgz ********** "Aldo" <...

How do i change the height and width of a single cell in Excel?
You change the height of the cell by changing the height of the entire row, and the width of the cell by changing the width of the entire column. The cell cannot be independently resized, because then all the other cells wouldn't fit. You can merge contiguous rectangular ranges together to create super-cells. Depending on your objective, merging cells may have undesired side-effects. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ lotus1107 wrote: ...

Opening Lotus *.123 files in Excel
Is there a convertion filter for opening Lotus *.123 files in Excel. I can convert *.wk? files, but I am unable to open *.123 (Lotus 1-2-3 Release 9 for Windows) files "Jim Warren" <Jim Warren@discussions.microsoft.com> wrote... >Is there a convertion filter for opening Lotus *.123 files in Excel. >I can convert *.wk? files, but I am unable to open *.123 (Lotus 1-2-3 >Release 9 for Windows) files The .wk? file formats predated Microsoft securing +90% market share, so way back then they had to compete in terms of interoperability. The .123 file format came after Mi...

Load Data Under Column Headings
My data are stock prices that I want to use with Metastock. I have as column headers: Date, Stock Name, Open, High, Low, Close, Stock Code. How do I load stock data with their fields under the respective column headings, perhaps, by just clicking on the file name, without using cut & paste. How do I protect the heading row from being overwritten? ...

excel 97 xml import
I have Excel 97 and need to import a XML file. I don't know vba. Slinger XL97 was written way before XML therefore it will not handle it. Only XL2003 (Individual product or from Office Pro) will recognise and handle XML import/export -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "Slinger" <Slinger@discussions.microsoft.com> wrote in message news:D1D9952E-F741-4B11-8040-B27B34F382BE@microsoft.com... >I have Excel 97 and need to import a XML file. I don't know vba. ...

Concurrent access to private data
Hi, maybe it's a simple problem for most of you, but I can't find an easy way to quite simple problem, let me describe: Let's have this code: public ClassToChange() { ... //some other methods internal List<AnyDataClass> LockAndGetData() { Monitor.Enter(cs); return data; } internal Unlock() { Monitor.Exit(cs); } private object cs = new object(); private List<AnyDataClass> data = new List<AnyDataClass>(); } public class Editor { public Editor(ClassToChange editedObject) { this.editedObject = editedObject; } ...

syncing excel 2007...
hi all community members... I have excel 2007 and sync all my office 2007 files to a online backup. unfortunately for excel this is not done I have to restart my computer (windows ultimate) for it to be synced (the company is ‘humyo’ which I think is one of the best...) I phoned them up and was told I must have ‘some sort of lock’ on these workbooks. I have been through the settings and thought it was privacy/personal information but am lost. can someone please help and I look forward to a reply. very much appreciated. Paul. I can't think of anyth...

protect borders on a data entry cell
I have an Excell 2007 spreadsheet with borders around selected cells, the spreadsheet is protected so my formulas cant get corrupted, but with some cells that are unlocked for user data entry. But when you copy and paste in these user entry cells the borders are getting copied and pasted also destroying the look of the spreadsheet. so how do you protect the borders from being changed and still allow copy and paste in the user entry cells? Thanks in advance Terry You could politely ask users to copy>paste VALUES -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin....

Excel power toy for media playlist...
Awhile back there was a power toy that would convert a media play list so that it could be opened in Excel. Anyone got a copy or know where I could download a copy? Thanks. Frank Frank wrote: > Awhile back there was a power toy that would convert a media play list > so that it could be opened in Excel. > Anyone got a copy or know where I could download a copy? > Thanks. > Frank Never mind, I found it...the bonus pack! Frank ...

Excel graphs should allow copy & paste of individual bar formats
In excel graphs - bar charts, I make the last bar a hashed shading as it is a forcast. To do this I select only the last bar and change its formating. At the end of the month I want to change the format back to the same as all the other bars and make the new coming month's predicted value that hashed shading etc. Unfortunately excel will not allow copy and paste in this situation - so I have do open the format tab etc and then change. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggest...

How I import data without truncating zero in the beginning
I am importing data from text file to access database but it is truncating all the zeros if they come in the starting.... please help me to resolve this problem as there is a field name telephone number and I need zero in the starting to distinguish between local and international calls. Remplace them by "+" (normaly it's the same) "Mohsin Habib" <MohsinHabib@discussions.microsoft.com> a écrit dans le message de news:8B32A18C-E88B-4259-8CAE-332EB821883C@microsoft.com... >I am importing data from text file to access database but it is truncating > ...

OWA Access denied to domain users Exchange 2000
Hi I have set up a new virtual directory to access the mail from OWA for the domain abc.com. When I type the OWA URL I get the prompt. I try user A@abc.com and it works. Then I try user B@abc.com and it denies access. I am at a loss to understand why some users in the domain can log in to OWA and some users can't. I'd appreciate any help in this matter. Thanks & Regards Any help? soup_or_power@yahoo.com wrote: > Hi > I have set up a new virtual directory to access the mail from OWA for > the domain abc.com. When I type the OWA URL I get the prompt. I try > user A@abc...

Importing JEs through the Table Import
Is there a way to import JEs throught the table import. If so, how is this accomplished? Please help! Thank you! If you have access to table import you must also own integration manager. either way, yes, you can import transactions. please give me a call at 214-373-8550 and we can walk through the process. Leslie "Christina" wrote: > Is there a way to import JEs throught the table import. If so, how is this > accomplished? Please help! Thank you! You can use Table Import but Integration Manager is much, much easier to use. If you can use Table Import, you own Inte...

how do I type over a pic on excel
Unless you put the picture in the Background (Format/Sheet/Background), in which case it will be tiled throughout the entire sheet, you can't directly type over a picture because pictures "live" in the Drawing layer above the cells. You can make the picture transparent (Format/Picture) to see text in the cells beneath. You can also use the Camera Tool to create a linked picture of a cell and position it on top of the other picture. Set the Fill to No fill, and the border to No Line. What I do is to put a text box over the picture and format it with n lines and no fill...

recover damaged excel file
I have a workbook creater with Excel 2000 just a few days ago but there's no way to open it. Coud anyone give me any suggestion? Hi, what message do you get?, ask your IT department usually they backup all the files, did you send the file to somebody? "Nora_Italy" wrote: > I have a workbook creater with Excel 2000 just a few days ago but there's no > way to open it. Coud anyone give me any suggestion? Thank you Eduardo. I don't get any error message, the file just doesn't open. Unfortunatately we backup files only once a month and I created...

Importing Dynamic data
Hi I have some tables in various xl files, call the files a,b and c. I want to import all these into a single xl file called e. If changes are made to a,b or c I want it to automatically update e. I have used the import function in d but if I change a,b or c to see the change I have to select the data in d and press refresh. Furthermore when I refresh d i have to have files a,b and c open otherwise it says connection lossed and is unable to refresh the data. Can someone explain to me in simple terms what I have to do in order to get the data automatically updated without having to alway...

Flipping order of data in a column
I need to flip the order of data in a column. For example: Is: 22 10 23 Need: 23 10 22 How can I do this? I need only flip the data in a column, these cell are not a part of rows of data thus no ther data must flip with thes numbers. Obviously the data I am changing is more than 3 cells long (- -- Message posted from http://www.ExcelForum.com Hi one way (using a helper column - if this is a one-time operation). If your data is in column A enter the following: B1: 1 B2: 2 - select B1:B2 and drag the selection down. This will populate column B with ascending numbers - Sort column A+B wit...