473,395 Members | 1,377 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,395 software developers and data experts.

How to write by VBA in an embedded xls-file?

Hi,

I want to show an excel-graphs in one of my access-forms.
The problem is how to refer to an embedded excel-file in my form.
I can refer to an external excelfile (see below) an do some test stuff
in this file but how can I do the same thing in an embedded Xls-file
like "Forms![frmTestForm]![OLEUnbound77]" ?

'open the workbook
Workbooks.Open filename:="C:\Test stuff\temp.xls"
'select sheet "Data"
ActiveWorkbook.Sheets("Data").select
'select whole sheet
Cells.select
'Clear the sheet

Selection.ClearContents
'For example, write "testing" in cell A1
Range("A1")= "testing"
'Save the workbook
ActiveWorkbook.Save
'and exit
ActiveWorkbook.Close

Replies please in this newsgroup
If you want to mail me:
Replace the nul in the adress by a zero.
Nov 13 '05 #1
1 1752
Ik wilde je er net op wijzen dat nul in het Engels zero is... eerst kijken!

How about using Microsoft Graph, available in reports for Access? Ah,
you ask for form functionality.

Apart from answers you get here, try an Excel group as well (don't
mention Access there ;-) )
You want to control Excel through its own VBA dialact, I am afraid.

veens-zevenhonderdvijf wrote:
Hi,

I want to show an excel-graphs in one of my access-forms.
The problem is how to refer to an embedded excel-file in my form.
I can refer to an external excelfile (see below) an do some test stuff
in this file but how can I do the same thing in an embedded Xls-file
like "Forms![frmTestForm]![OLEUnbound77]" ?

'open the workbook
Workbooks.Open filename:="C:\Test stuff\temp.xls"
'select sheet "Data"
ActiveWorkbook.Sheets("Data").select
'select whole sheet
Cells.select
'Clear the sheet
Selection.ClearContents
'For example, write "testing" in cell A1
Range("A1")= "testing"
'Save the workbook
ActiveWorkbook.Save
'and exit
ActiveWorkbook.Close

Replies please in this newsgroup
If you want to mail me:
Replace the nul in the adress by a zero.


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #2

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

Similar topics

3
by: S.Byers | last post by:
I want to list *.CSV and *.XLS files in a drop down menu using dlgFileToImport.Filter = "CSV Files (*.csv)| *.csv" dlgFileToImport.Filter = "Excel Files (*.xls)| *.xls"...
1
by: nickolausp | last post by:
When embedding a JavaScript document.write within a JavaScript document.write in Netscape 4.x (example below), the text is written out of logical order. <script type="text/javascript"> <!--...
0
by: jpodesta | last post by:
Hello- I am fairly new to MS Access and would like to use some macros in .xls in an Access Module. I have tried to do this on my own but failed to make it work. I have included the xls macros...
0
by: jpodesta | last post by:
Hello- I am fairly new to MS Access and would like to use some macros in .xls in an Access Module. I have tried to do this on my own but failed to make it work. I have included the xls macros...
18
by: jacob navia | last post by:
In C, we have read-only memory (const), read/write memory (normal data), and write only memory. Let's look at the third one in more detail. Write only memory is a piece of RAM that can only...
2
by: Jani Mantytorma | last post by:
I have embedded resource called Settings.xml. I'm able to read the resource but how can I write data to the resource. The code for read operation follows: private XmlDocument m_doc = new...
7
by: Solel Software | last post by:
Hi, I have an XLS that I am looking to open in a web form and grab it's information into a Dataset. I have been able to do so but am having trouble with Zip Codes. When the Zip Code column in...
0
by: SAL | last post by:
Has anyone created Embedded Links programmatically before? I have a VB.net and ASP.net Web Application developed in VS.net 2003. What I am trying to do/find is information on how to create an...
0
by: sundowner225 | last post by:
Could someone help me with an output problem? I have an access database that I need to create some xls output from. Basically, I have three tables: Faculty_Table: Fields=ID,Name, Type,...
1
by: Charlotte | last post by:
Hallo, Graag hulp, want ik heb zelf geen oplossing Al gegoogeld, doch zonder concreet resultaat Op onze webserver (intranet) hebben we een website draaien Een bepaalde ASP-pagina haalt zijn...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.