PC Review


Reply
Thread Tools Rate Thread

Call Excel in VBA

 
 
luis.a.roman@gmail.com
Guest
Posts: n/a
 
      11th Jun 2008
Is there anyway in ms access to call an excel spreadsheet in show
mode? This is the show mode that a power point can be presented.

Please advise.

Luis
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      11th Jun 2008
The code below is from Access VBA help for Getobject


Sub GetExcel()
Dim MyXL As Object ' Variable to hold reference
' to Microsoft Excel.
Dim ExcelWasNotRunning As Boolean ' Flag for final release.

' Test to see if there is a copy of Microsoft Excel already running.
On Error Resume Next ' Defer error trapping.
' Getobject function called without the first argument returns a
' reference to an instance of the application. If the application isn't
' running, an error occurs.
Set MyXL = Getobject(, "Excel.Application")
If Err.Number <> 0 Then ExcelWasNotRunning = True
Err.Clear ' Clear Err object in case error occurred.

' Check for Microsoft Excel. If Microsoft Excel is running,
' enter it into the Running Object table.
DetectExcel

' Set the object variable to reference the file you want to see.
Set MyXL = Getobject("c:\vb4\MYTEST.XLS")

' Show Microsoft Excel through its Application property. Then
' show the actual window containing the file using the Windows
' collection of the MyXL object reference.
MyXL.Application.Visible = True
MyXL.Parent.Windows(1).Visible = True
Do manipulations of your file here.
' ...
' If this copy of Microsoft Excel was not running when you
' started, close it using the Application property's Quit method.
' Note that when you try to quit Microsoft Excel, the
' title bar blinks and a message is displayed asking if you
' want to save any loaded files.
If ExcelWasNotRunning = True Then
MyXL.Application.Quit
End IF

Set MyXL = Nothing ' Release reference to the
' application and spreadsheet.
End Sub



"(E-Mail Removed)" wrote:

> Is there anyway in ms access to call an excel spreadsheet in show
> mode? This is the show mode that a power point can be presented.
>
> Please advise.
>
> Luis
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
call a DLL within Excel. Jim15 Microsoft Excel Programming 0 21st Mar 2006 05:13 PM
Warning 1684 CA2214 : Microsoft.Usage : 'RandomShade..ctor(Int32, Int32, Int32, Int32, Int32)' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences: steve bull Microsoft C# .NET 4 7th Jul 2005 05:54 PM
COM-call-in to Excel John Kessel Microsoft Excel Programming 1 6th Nov 2004 10:11 PM
Call of excel through C# dimitris Microsoft Dot NET Framework 1 18th Dec 2003 04:52 PM
How to call SolverSolve portably for Excel XP and Excel 2000 Chris Russell Microsoft Excel Programming 3 10th Sep 2003 05:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 PM.