Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default external link to start excel form

Through a lot of trial and error, I finally got an excel form to run (I'm new
to this). I'd like to start the form from within a powerpoint presentation.
I can link to the macro in excel to start the form but then have to run the
macro. I'd like to be able to just click on something from powerpoint that
will make the excel form pop up (automatically run the macro). Is there some
code that I can copy or is there another way of getting this to work?

Thank you in advance for your help.
Lorraine
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default external link to start excel form

insert the following into your workbook code

Private Sub Workbook_Open()
ActiveWindow.WindowState = xlMinimized
UserForm1.Show
End Sub

(where UserForm1 is the name of your form)

You should then be able to create a hyperlink to the excel file from within
powerpoint and when clicked on it will show the form but it should still keep
the powerpoint slide in the background.

Hope this helps..



"lorraine" wrote:

Through a lot of trial and error, I finally got an excel form to run (I'm new
to this). I'd like to start the form from within a powerpoint presentation.
I can link to the macro in excel to start the form but then have to run the
macro. I'd like to be able to just click on something from powerpoint that
will make the excel form pop up (automatically run the macro). Is there some
code that I can copy or is there another way of getting this to work?

Thank you in advance for your help.
Lorraine

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default external link to start excel form

Using Automation, you could....

1) Make sure that there is a macro in the Excel workbook
that opens the form.
Example:
Public Sub OpenTheForm()
ufTest.Show
End Sub
- where 'OpenTheForm' is the macro
- where 'ufTest' is the name of the form

2) In PowerPoint, create a Command Button on your slide by...
- opening up the 'Control Toolbox' commandbar
- select the 'Command Button'
- draw the button at the bottom of the slide

3) Right Click on the Command Button and go to 'Properties'

4) Change the Caption to something like 'Open Excel Form'

5) x out of the Properties window

6) Double-click on the Command Button and the
Visual Basic Editor will appear

7) You will see something like...
Private Sub CommandButton1_Click()

End Sub

8)
- where strMacro is the macro in Excel
that opens the form
- where strWorkbook is the workbook that
contains the form
Replace that code with...

'/--- S T A R T -- O F -- M A C R O --------------/
Private Sub CommandButton1_Click()
Dim appExcel As Object
Dim strWorkbook As String
Dim strMacro As String
Dim x As Variant

On Error GoTo err_Sub

'- - - - V A R I A B L E S - - - - - -
strWorkbook = "C:\Temp\Book1.xls"
strMacro = "OpenTheForm"
'- - - - V A R I A B L E S - - - - - -

'open a new instance of Microsoft Excel (late binding)
Set appExcel = CreateObject("Excel.Application")
appExcel.Application.Visible = True

'Open a workbook
appExcel.Application.Workbooks.Open strWorkbook

'run the macro in Excel that opens the form
x = appExcel.Application.Run(strMacro)

'close the workbook with the form without saving
appExcel.ActiveWorkbook.Close SaveChanges:=False

'get out of Excel
appExcel.Quit

exit_Sub:
On Error Resume Next
Set appExcel = Nothing
Exit Sub

err_Sub:
Debug.Print "Error: " & Err.Number & " - (" & _
Err.Description & ") - " & Now()
GoTo exit_Sub

End Sub
'/--- E N D -- O F -- M A C R O --------------/

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"lorraine" wrote:

Through a lot of trial and error, I finally got an excel form to run (I'm new
to this). I'd like to start the form from within a powerpoint presentation.
I can link to the macro in excel to start the form but then have to run the
macro. I'd like to be able to just click on something from powerpoint that
will make the excel form pop up (automatically run the macro). Is there some
code that I can copy or is there another way of getting this to work?

Thank you in advance for your help.
Lorraine

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel cannot auto start external application Jason Falzon[_2_] Excel Discussion (Misc queries) 0 March 25th 10 08:57 AM
Excel 2007 External Link error munish Excel Discussion (Misc queries) 0 January 14th 09 09:02 AM
EXCEL 2007 EXTERNAL LINK ERROR-NEED HELP munish Excel Discussion (Misc queries) 0 July 10th 08 10:05 AM
Excel- how to create external link with autoupdate P Bajaj Excel Discussion (Misc queries) 1 November 8th 06 12:41 PM
Can I break an external link in Excel 97? stadco Excel Discussion (Misc queries) 1 January 11th 05 04:34 PM


All times are GMT +1. The time now is 02:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"