Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 11:36 AM
veens-zevenhonderdvijf
Guest
 
Posts: n/a
Default 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.

  #2  
Old November 13th, 2005, 11:38 AM
Bas Cost Budde
Guest
 
Posts: n/a
Default Re: How to write by VBA in an embedded xls-file?

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:
[color=blue]
> 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.[/color]

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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.