473,418 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

How do I gain control of an Excel Spreadsheet embedded in an Access form?

I have been working on an application that queries data from Access, loads
it into an array, and then writes it to an Excel spreadsheet. I use the
array approach to have fine control over spacing, formatting, etc. I have
gotten the first part of this to work by opening an Excel spreadsheet,
writhing the data, saving the spreadsheet and closing it. But what I would
like to do is to not actually open up Excel outside of Access. I want to
write the data to a spreadsheet embedded on the main form.

When the form runs, I can click on the spreadsheet and manually enter data,
but I cannot figure out what VBA commands to use to grab hold of the
spreadsheet. Can anyone point me in the right direction? Thanks.
Nov 12 '05 #1
2 7959
Use an unbound Frame control from the toolbox in a Form's design view.
You can embed an Excel spreadsheet in this control. Just follow the
wizard.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #2
"Rich P" <rp*****@aol.com> wrote in message
news:3f***********************@news.frii.net...
Use an unbound Frame control from the toolbox in a Form's design view.
You can embed an Excel spreadsheet in this control. Just follow the
wizard.


Thanks. I have done that, but when I want to write the information to the
Excel spreadsheet, how do I do that? In regual Excel, I declare an object
variable and instantiate it. Then I query the Access database, load the
recordset into an array of customtype, and write the data to individual
cells in the ActiveWorksheet. For example:

For iCtr = 1 To UBound(FundPerfArray)
oXLWKS.Range("B" & N) = FundPerfArray(iCtr).strFund_Name
oXLWKS.Range("C" & N) = FundPerfArray(iCtr).str_Category
oXLWKS.Range("D" & N) = FundPerfArray(iCtr).strTicker
...
Next iCtr

This code writes to cells in the ActiveWorksheet. I want to do the same
thing with the spreadsheet embedded in the form so that the user has a
preview of what the final output will be and also will have the opportunity
to modify it. But I cannot seem to find how to access the Range property of
the embedded spreadsheet. The object inspector only shows properties such
as boderstyle, height, width, etc. Can't you use VBA to write to this
embedded sheet as opposed to only using it in an interactive fashion?
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
4
by: Martin | last post by:
There is an Access table on the network. 15 users who do not have Access are connected to the network. Is there a way for each user to be able to enter one or more rows containing 3 or 4 columns to...
8
by: jack | last post by:
Access is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it...
1
by: garry.oxnard | last post by:
Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please? I have an Excel template which, on open, also opens an Access...
3
by: GH | last post by:
Does anyone know how I can access (using OleDbConnection, I presume) a spreadsheet embedded in a cell of another spreadsheet (with vb.net)? Thanks, GH
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
7
by: semijoyful | last post by:
OS: Win XP SP2 Access version: 2003 Excel version: 2003 I am new at this, as I am sure you have gathered from this post title:) I am working on a form where users can input data in Access and...
12
by: slinky | last post by:
Can an Excel spreadsheet or a section of one be embedded into an Access form and serve as a subform from which other parts of the Access form can get data? Thanks!
0
by: Tony Hine | last post by:
Problem for Excel Developers One of the problems facing Excel developers moving into MS Access is actually the apparent similarity between MS Access tables and Excel spreadsheets. MS Access is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.