By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,482 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,482 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.