Sabtu, 14 Januari 2012

Re: [ExcelVBA] How get full live Excel workbook access from PowerPoint slide?

 

I suspect it is the Range() call in the Reference parameter that is giving
you grief.

PowerPoint will be looking in its own DOM for a Range() function, that might
not exist.

Try qualifying the Range() call. I would recommend creating a reference to
the active sheet

Set ActiveWorksheet = ExcelApp.ActiveWorkbook.ActiveSheet

(untested, but I think that's the syntax) and qualifying the Range() and
other on-sheet references to that.

Actually you should have created a reference to the Excel workbook first, so
that you don't need to keep referencing through the ExcelApp and
ActiveWorkbook.

Hmmm ... you do have these variables declared: ExcelwBook and wSheet, but
you don't seem to have given them any values.

Regards, Dave S

----- Original Message -----
From: "Roger" <rogerbelling@yahoo.ca>
To: <ExcelVBA@yahoogroups.com>
Sent: Sunday, January 15, 2012 6:55 AM
Subject: [ExcelVBA] How get full live Excel workbook access from PowerPoint
slide?

>
> Of the following 2 PowerPoint VBA codes, the first works for me but the
> second, a shade more ambitious in trying the .Goto method, doesn't.
> Can anyone tell why? What is holding up the .Goto? Are there any holes
> in MS Office "interoperability"?
>
>
>
> 'mySlideShow.ppt Slide1
>
> Option Base 1
>
> Option Explicit
>
>
>
> Private Sub CommandButton1_Click()
>
> Dim ExcelApp As Object, ExcelwBook1 As Object, ExcelwBook2 As Object,
> WBook2 As String, MySheet3 As Object
>
> Set ExcelApp = CreateObject("Excel.Application")
>
> ExcelApp.Visible = True
>
> WBook2 =
> "D:\Projects\Housing\HousingInflation\ResamplingForUnbiasedTimeSeriesReg\
> ression\MyProtoFolder\MyWorkbook2.xls"
>
> ExcelApp.Workbooks.Open (WBook2)
>
> ExcelApp.Workbooks(1).Sheets(3).Activate
>
> Stop
>
> ExcelApp.Workbooks(1).Close SaveChanges:=False
>
> ExcelApp.Quit
>
> Set ExcelApp = Nothing
>
> End Sub
>
>
>
> Private Sub CommandButton5_Click() 'Cross-Check
>
> 'On optionally clicking, displays for a few preview seconds the Slope
> Variability vs. Autocorrelation graph of moloTables&Graphs.xls
>
> Dim ExcelApp As Object, ExcelwBook As Object, wBook As String, wSheet As
> Object, Start As Single
>
> Set ExcelApp = CreateObject("Excel.Application")
>
> ExcelApp.Visible = True
>
> wBook =
> "D:\moloBackgroundPackageForDriveD\Mishmash\moloTables&Graphs.xls"
>
> ExcelApp.Workbooks.Open (wBook)
>
> ExcelApp.ActiveWorkbook.Sheets("MethodsCompare2B").Activate
>
> Stop 'how make PowerPoint interpreter accept the following Excel VBA?
>
>
>
> 'ExcelApp.Goto Reference:=Range("A62:Q96"), Scroll:=True ' "Sub or
> function not defined"
>
> 'Range("I77").Select 'desired cursor resting position
>
>
>
> Start = Timer
>
> Do While Timer < Start + 2 'Allow 2 seconds of preview dwell
> time
>
> 'and return to Slide 1 automatically
>
> DoEvents ' Yield to other processes.
>
> Loop
>
> ExcelApp.Workbooks(1).Close SaveChanges:=False
>
> ExcelApp.Quit
>
> Set ExcelApp = Nothing
>
> End Sub
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
> here: http://www.mousetrax.com/techtrax to enter the ezine, then search
> the ARCHIVES for EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>
>
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1416 / Virus Database: 2109/4141 - Release Date: 01/13/12
>

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar