VBA Question

I have written a VBA Panel with one of the buttons being a page upand
page down button using the following code


Private Sub CommandButton26_Click()
    On Error Resume Next
        With ActiveWindow.View
            Call .GotoSlide(.Slide.SlideIndex + 1)
        End With
End Sub

The code works in the slide view but not the slide master view.  What
am I missing?
0
Jeff
2/6/2010 12:42:40 PM
powerpoint 2011 articles. 0 followers. Follow

10 Replies
754 Views

Similar Articles

[PageSpeed] 11

What would you expect it to do in Master view?
(There are no slides to goto in this view)
-- 
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html






"Jeff@MSN.com" wrote:

> I have written a VBA Panel with one of the buttons being a page upand
> page down button using the following code
> 
> 
> Private Sub CommandButton26_Click()
>     On Error Resume Next
>         With ActiveWindow.View
>             Call .GotoSlide(.Slide.SlideIndex + 1)
>         End With
> End Sub
> 
> The code works in the slide view but not the slide master view.  What
> am I missing?
> .
> 
0
Utf
2/6/2010 2:27:01 PM
i am nre to VBA ...any suggestions?


On Sat, 6 Feb 2010 06:27:01 -0800, John Wilson <john AT
technologytrish.co DOT uk> wrote:

>What would you expect it to do in Master view?
>(There are no slides to goto in this view)

0
Jeff
2/6/2010 4:46:54 PM
In article <pooqm59reqif120nolefjsvctpvmvugliq@4ax.com>, Jeff@MSN.com 
wrote:
> I have written a VBA Panel with one of the buttons being a page upand
> page down button using the following code
> 
> Private Sub CommandButton26_Click()
>     On Error Resume Next
>         With ActiveWindow.View
>             Call .GotoSlide(.Slide.SlideIndex + 1)
>         End With
> End Sub
> 
> The code works in the slide view but not the slide master view.  What
> am I missing?

You should be getting an error message along the lines of "This view 
does not support that action" ... which pretty well sums it up.  You 
can't do that here.

You'll probably have to send PageUp/PageDown keys to the app using 
SendKeys.  Assuming you've got a list of the master names, you could 
send pageups and checking the ActiveWindow.View.Slide.Name until two 
successive checks return the same name.  Then you know you're at the 
top of the stack.  Then send PageDowns until you get to the number or 
name you're after.

==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


0
Steve
2/6/2010 5:03:27 PM
I just don't see what you want to happen in master view?
-- 
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html






"Jeff@MSN.com" wrote:

> i am nre to VBA ...any suggestions?
> 
> 
> On Sat, 6 Feb 2010 06:27:01 -0800, John Wilson <john AT
> technologytrish.co DOT uk> wrote:
> 
> >What would you expect it to do in Master view?
> >(There are no slides to goto in this view)
> 
> .
> 
0
Utf
2/6/2010 5:39:01 PM
On 2/6/10 7:42 AM, Jeff@MSN.com wrote:
> I have written a VBA Panel with one of the buttons being a page upand
> page down button using the following code
>
>
> Private Sub CommandButton26_Click()
>      On Error Resume Next
>          With ActiveWindow.View
>              Call .GotoSlide(.Slide.SlideIndex + 1)
>          End With
> End Sub
>
> The code works in the slide view but not the slide master view.  What
> am I missing?

As John said, you'll have to explain a little better what you are trying 
to do. Among John and Steve and me, I'll bet we could solve just about 
any of your VBA problems (mostly John and Steve), but we can't help if 
we don't know what you want to do. Do you want to:

(1) Have this work in Slide Show View?
(2) Have this work in Master view by jumping out of master view and 
jumping to the slide?

Perhaps, you want something like:


With ActivePresentation.SlideShowWindow.View
	.GotoSlide .Slide.SlideIndex + 1
End With

This is a version of your code that will work in Slide Show View, which 
seems like what you want because you seem to be attaching this to a 
button, which means you want to click it, and that usually happens in 
Slide Show view.

--David

-- 
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
0
David
2/6/2010 7:44:44 PM
I will try to make it clearer and I appreciate the help .  

I seemed to be asked to make a lot of powerpoints so I have created a
custom userform with multiple command buttons the do different
functions (position shapes, change colors etc).  An example would be
to nudge a picture left or right by a set amounts. Two command buttons
are page up and another a page down.  It is convenient to have them
there because it means I can scroll through the presentation with the
mouse to make changes on each slide. Otherwise I have to use the
keyboard and the mouse

The code I wrote works on the slides but if I wan to make the changes
to multiple slide masters the command button page up and down keys do
not work.  The is no "GotoSlideMaster" function


On Sat, 06 Feb 2010 14:44:44 -0500, David Marcovitz
<marco@nospamloyola.edu> wrote:

>On 2/6/10 7:42 AM, Jeff@MSN.com wrote:
>> I have written a VBA Panel with one of the buttons being a page upand
>> page down button using the following code
>>
>>
>> Private Sub CommandButton26_Click()
>>      On Error Resume Next
>>          With ActiveWindow.View
>>              Call .GotoSlide(.Slide.SlideIndex + 1)
>>          End With
>> End Sub
>>
>> The code works in the slide view but not the slide master view.  What
>> am I missing?
>
>As John said, you'll have to explain a little better what you are trying 
>to do. Among John and Steve and me, I'll bet we could solve just about 
>any of your VBA problems (mostly John and Steve), but we can't help if 
>we don't know what you want to do. Do you want to:
>
>(1) Have this work in Slide Show View?
>(2) Have this work in Master view by jumping out of master view and 
>jumping to the slide?
>
>Perhaps, you want something like:
>
>
>With ActivePresentation.SlideShowWindow.View
>	.GotoSlide .Slide.SlideIndex + 1
>End With
>
>This is a version of your code that will work in Slide Show View, which 
>seems like what you want because you seem to be attaching this to a 
>button, which means you want to click it, and that usually happens in 
>Slide Show view.
>
>--David

0
Jeff
2/7/2010 12:56:27 PM
Try using sendkeys to simulate the keypress (here the up down arrows)

Private Sub CommandButton1_Click()
ActiveWindow.Panes(1).Activate
SendKeys "{UP}"
End Sub

Private Sub CommandButton2_Click()
ActiveWindow.Panes(1).Activate
SendKeys "{DOWN}"
End Sub

NOTE the form will have to be NON modal I think for this to work

UserFormx.Show(0)
-- 
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html






"Jeff@MSN.com" wrote:

> I will try to make it clearer and I appreciate the help .  
> 
> I seemed to be asked to make a lot of powerpoints so I have created a
> custom userform with multiple command buttons the do different
> functions (position shapes, change colors etc).  An example would be
> to nudge a picture left or right by a set amounts. Two command buttons
> are page up and another a page down.  It is convenient to have them
> there because it means I can scroll through the presentation with the
> mouse to make changes on each slide. Otherwise I have to use the
> keyboard and the mouse
> 
> The code I wrote works on the slides but if I wan to make the changes
> to multiple slide masters the command button page up and down keys do
> not work.  The is no "GotoSlideMaster" function
> 
> 
> On Sat, 06 Feb 2010 14:44:44 -0500, David Marcovitz
> <marco@nospamloyola.edu> wrote:
> 
> >On 2/6/10 7:42 AM, Jeff@MSN.com wrote:
> >> I have written a VBA Panel with one of the buttons being a page upand
> >> page down button using the following code
> >>
> >>
> >> Private Sub CommandButton26_Click()
> >>      On Error Resume Next
> >>          With ActiveWindow.View
> >>              Call .GotoSlide(.Slide.SlideIndex + 1)
> >>          End With
> >> End Sub
> >>
> >> The code works in the slide view but not the slide master view.  What
> >> am I missing?
> >
> >As John said, you'll have to explain a little better what you are trying 
> >to do. Among John and Steve and me, I'll bet we could solve just about 
> >any of your VBA problems (mostly John and Steve), but we can't help if 
> >we don't know what you want to do. Do you want to:
> >
> >(1) Have this work in Slide Show View?
> >(2) Have this work in Master view by jumping out of master view and 
> >jumping to the slide?
> >
> >Perhaps, you want something like:
> >
> >
> >With ActivePresentation.SlideShowWindow.View
> >	.GotoSlide .Slide.SlideIndex + 1
> >End With
> >
> >This is a version of your code that will work in Slide Show View, which 
> >seems like what you want because you seem to be attaching this to a 
> >button, which means you want to click it, and that usually happens in 
> >Slide Show view.
> >
> >--David
> 
> .
> 
0
Utf
2/7/2010 3:18:01 PM
THANKS

On Sun, 7 Feb 2010 07:18:01 -0800, John Wilson <john AT
technologytrish.co DOT uk> wrote:

>Try using sendkeys to simulate the keypress (here the up down arrows)
>
>Private Sub CommandButton1_Click()
>ActiveWindow.Panes(1).Activate
>SendKeys "{UP}"
>End Sub
>
>Private Sub CommandButton2_Click()
>ActiveWindow.Panes(1).Activate
>SendKeys "{DOWN}"
>End Sub
>
>NOTE the form will have to be NON modal I think for this to work
>
>UserFormx.Show(0)

0
Jeff
2/8/2010 4:03:08 AM
Did you get it to work?
-- 
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html






"Jeff@MSN.com" wrote:

> THANKS
> 
> On Sun, 7 Feb 2010 07:18:01 -0800, John Wilson <john AT
> technologytrish.co DOT uk> wrote:
> 
> >Try using sendkeys to simulate the keypress (here the up down arrows)
> >
> >Private Sub CommandButton1_Click()
> >ActiveWindow.Panes(1).Activate
> >SendKeys "{UP}"
> >End Sub
> >
> >Private Sub CommandButton2_Click()
> >ActiveWindow.Panes(1).Activate
> >SendKeys "{DOWN}"
> >End Sub
> >
> >NOTE the form will have to be NON modal I think for this to work
> >
> >UserFormx.Show(0)
> 
> .
> 
0
Utf
2/8/2010 12:25:01 PM
Yes
On Mon, 8 Feb 2010 04:25:01 -0800, John Wilson <john AT
technologytrish.co DOT uk> wrote:

>Did you get it to work?

0
Jeff
2/18/2010 2:24:36 AM
Reply:

Similar Artilces:

VBA code to say Yes or No if any VBA code is present in ActiveWork
Using XL 2003 & 97 Would like hit Ctrl+Shift+V and have an answer either yes or no as to the presence of Any VBA code in the Active Workbook. I do know that about the VBA editor/Explorer or to press the Run Macro button and get a list from various sources . I would like to stay at the keyboard and process a series of macros including one to let me know if I even need to evoke the VBA explorer. TIA Dennis There is no bootstrap macro to tell you whether you have macros or not. If there were there would be no limit to virus writers. --- HTH, David McRitchie, Microsoft MVP - Excel ...

Print, Merged Cells, and VBA
Hello I'm looking for a code that will help me with a print job for a worksheet. There are a lot of merged cells and a lot of "IF"s to be used in the VBA for range selection. Thanks in advance, Sarr ...

Simple question on Cursor
Hello, I have a simple dialog box application and I would like to change the cursor from an arrow to an hourglass when I press a button. In my OnClick event, I have this code void Button::OnClick() { hCursor=AfxGetApp()->LoadStandardCursor(IDC_WAIT); .... hCursor=AfxGetApp()->LoadStandardCursor(IDC_ARROW); } Can someone explain to me on how to get this working? Thank-you Hello Try using BeginWaitCursor() then later EndWaitCursor() Regards, Elias "dmoss22922" <dmoss22922@email.msn.com> wrote in message news:eoJxEphcDHA.2904@TK2MSFTNGP11.phx.gbl... > Hello,...

Use VBA to update Access table or Query from Excel
Can I use VBA to update Access table or Query from Excel? Thanks in advance Hi Leungkong, > Can I use VBA to update Access table or Query from Excel? Of course, using ADO or DAO. See: http://www.erlandsendata.no/english/index.php?d=envbadacexportado Regards, Jan Karel Pieterse Excel MVP http://www.jkp-ads.com Hi Jan, Thanks. I think ADO is what I want. But I am not only want to export from excel to access. I want to edit some data in access table. For example, Access has a table "ProductList" I want to use Excel to call the product by "Pro...

VBA and Scheduled task in Outlook
Hi, how can I: a) pull the query from somewhere and send it by e-mail automatically. E.g. I want to take a temperature table from http://www.wunderground.com/history/airport/EHAM/2009/7/10/DailyHistory.html?req_city=NA&req_state=NA&req_statename=NA where 2009/7/10 is the date of yesterday put it into an e-mail and send it automatically each day at 8 o'clock? b) if this is not possible, how can I send an e-mail with the attachment c:\Documents\query20090710.xls each day at 8 o'clock? my boss wants this automatized, I know how to write the VBA code for Excel, but don'...

Column width and pasting sections in excel? Formatting questions
I am trying to make a spreadsheet in which I need to have varied column widths in different sections, one under another. (they don't need to relate directly, and no major equations going on) for example: xxxxxxxxx|xxxxxxxxxx xxxxxxxxx|xxxxxxxxxx xxxxxxxxx|xxxxxxxxxx xxxxxxx|xxxxx|xxxxxx xxxxxxx|xxxxx|xxxxxx How do I go about splitting the sheet or whatever I need to do so I can manipulate columns differently based on the row I'm in? Thanks! Rich Column widths apply to the whole column. You may be able to use merged cells to give the appearance that you want, but I try to stay...

vba select field
Hi, having a button on a form, is it possible to select only some fields (all from the same table) of the current record instead of all fields? I've tried this code: RunCommand acCmdSelectRecord RunCommand acCmdCopy Forse dipende dei dati nel record. but it selects ALL fields in the form. Thank you. Remigio hi, On 10.04.2010 18:01, remigio wrote: > having a button on a form, is it possible to select only some fields > (all from the same table) of the current record instead of all fields? > I've tried this code: > > RunCommand acCmdSelectRecord &...

VLOOKUP in VBA
On the worksheet I can insert in a cell =VLOOKUP(C5, Hobokee.xls!AcsLow, 2) and it works perfectly, looks up the value in column 2 of the range named AcsLow in the same workbook. But elswhere I want in a macro to lookup the same table and assign the result to a variable BalAmt. BalAmt = VLOOKUP(AccNum, Hobokee.xls!AcsLow, 2) does not work. It gives a function not defined error on Hobokee. If instead of Hobokee I put Workbooks("Hobokee"), it gives function not defined error for VLOOKUP which it changes to VLookup. I have been overVLOOKUP in the Help file and see nothing wrong. W...

Excel VBA/Macro programming for beginners
Hi all, I know a bit VB 6.0 programming. Will it help me to write exce vba/macro(same thing?).can anybody help me by providing some fre websites where i can have informations/codes for VBA/macro. Please tell me how could i make a *command Button * in a cell in th excel sheet -- sdebu_200 ----------------------------------------------------------------------- sdebu_2000's Profile: http://www.officehelp.in/member.php?userid=430 View this thread: http://www.officehelp.in/showthread.php?t=118812 Posted from - http://www.officehelp.i Try David McRitchie's "getting started with mac...

Turn pc speaker on/off with vba code
Is this possible? Thanks I found something here on how to do it withVBScript. You can probably modify it to work in VBA http://www.pcreview.co.uk/forums/thread-1468591.php -- HTH, Barb Reinhardt "David" wrote: > Is this possible? > Thanks Thanks Barb I'll have a go (I need to improve my web searching skills) "Barb Reinhardt" wrote: > I found something here on how to do it withVBScript. You can probably modify > it to work in VBA > > http://www.pcreview.co.uk/forums/thread-1468591.php > -- > HTH, > ...

Access 2003 Form Question
I have an access database that I am using for site surveys. In a nutshell, there is a header table with a date and location as the keys and a detail section with the survey results. The detail section shows a series of 30 or so questions(from a questions table) on how the site was rated. I am trying to design a form that populates a yes/no/not available type response in the detail section. The user would either click on a yes/no/NA type box or have a drop down and select the value(whichever is easiest) next to the box. After the user answers the 30 or so questions, an answers table...

THE BIGGEST QUESTION OF ALL
After months trying to make things work, and now I found errors that did not come from my own ignorance but from MSRMS such as: --Wrong item description misteriously appearing on my matrix. --Zebra printer not printing hang tags properly. --lots of other questions unanswered, as you all here are asking... The big question is: If we pay $90 per incidence, it will cost thousands, but are there solutions? Consequently, shouldn't MS be responsible for the flaw in its software and provide this kind of technical support to be worth the original month we pay with the assumption that the...

Loading a Form from VBA
Hi all, I'd like a module to open and load a form in my Access 2003 database... How can I do this? Use the OpenForm method. Look in the Help file for details. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Mike" <michael.leon.schwartz@gmail.com> wrote in message news:1184770076.109526.207900@o11g2000prd.googlegroups.com... > Hi all, I'd like a module to open and load a form in my Access 2003 > database... How can I do this? > On Jul 18, 10:58 am, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com&g...

Excel and VBA
I am very interested in learning more about using VBA in office, especially Excel. Can you post some resources (online, books, etc) that can be used to help learn about using Visual Basic in office. Thanks! Here's a good place to start: http://www.contextures.com/xlbooks.html Does that help? *********** Regards, Ron XL2002, WinXP "Bob Sinclair" wrote: > I am very interested in learning more about using VBA in office, especially > Excel. Can you post some resources (online, books, etc) that can be used to > help learn about using Visual Basic in office. >...

VBA Customization
Is there a way to get the name of the current company through VBA in Great Plains 8.0? Thanks for all your help. open GreatPlains. Add the current window, it will add the Toolbar then add fields choose the company name on the top left after the user id. >-----Original Message----- >Is there a way to get the name of the current company through VBA in Great >Plains 8.0? > >Thanks for all your help. > > > >. > Thanks. I tried, but I couldn't add company name to the field list. It opens up the login screen instead. Any thoughts? Thanks again. "ger...

Run VBA without show
I want excel to run the VBA code without showing me what it is doing. Which code should i use for that? Sub RunWithoutShow() Application.ScreenUpdating = False 'Paste the vba code here 'end of code 'Change screenupdating property to true Application.ScreenUpdating = True End Sub I hope this helps... Selva V Pasupathy For more on Excel, VBA, & other Resources Please visit: http://socko.wordpress.com You may also (inserting into quote from code example bellow from Socko) Use Application.Visible property to hide the application entirely Sub RunWithoutShow() Appli...

Form Controls vs VBA controls
I am new to VBA so just finding my feet, can anyone help me with th differences between an excel control (i.e. one from the form toolbox lets say a checkBox and a vba checkBox? From trying the two controls the I have noticed is that you canno capture the change event of the VBA checkbox in the code module, it ha to be done via the sheet (i.e. checkbox on sheet1, code goes in chang event on sheet1) the control is placed on, is this correct? What woul you do if you have three sheets with the same controls just differen data, do you really have to code the control 3 times? The excel control ho...

DoModal() question.
I have a dialog class dlg. When I use dlg.DoModal(), there're always two buttons "Cancel" and "Ok" on popup window which I didn't put there. They seem to be put there by system default. How to remove them? Thanks. Frank E Rogers wrote: > I have a dialog class dlg. When I use dlg.DoModal(), there're always two > buttons "Cancel" and "Ok" on popup window which I didn't put there. They > seem to be put there by system default. How to remove them? > Thanks. > > First, you better add message handlers for them. Your ha...

Advanced Filters question
I sometimes use Msft Access to run a query, and then revise the query, or build off of the new query by creating a separate query of that query. However, in using excel, at least at first pass, I noticed that I was unable to pivot the data that resulted from an advanced filter, and I was unable to see the total amount for a given column, once an advanced filter was applied to a list (i.e., the sum that I saw was for the entire field and not for the records that were visible once I had applied the filter). Does anyone have any perspective they could share with me regarding this? Is there a wa...

Referencing a ComboBox in VBA
Hi, I am using Excel 2007. I want to run some code in my Workbook_Open() Sub that fills a combo box on one of my Worksheets (I will call it myCombo on mySheet). I tried the following code and it did not work: myCombo.Clear myCombo.AddItem "Item One" myCombo.AddItem "Item Two" myCombo.AddItem "Item Three" I assume that the problem is that within the Workbook_Open() Sub, the reference to myCombo is not valid. Can anyone tell me if/how I can get a valid reference to myCombo (on mySheet)? Thanks in advance, Paul Kraemer -- Paul Krae...

inserting and renaming a sheet vba
Instead of having 2 lines of code, one to insert a new sheet and one t rename it, is there a way to insert a sheet with particular name i one go -- Matt Housto ----------------------------------------------------------------------- Matt Houston's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=451 View this thread: http://www.excelforum.com/showthread.php?threadid=26717 ...

VBA??
Is there any way i can input certain numbers and they change to words. for example. 2001 Omagh 2002 Craigavon 2027 Housing Benefit 2036 IT Replacment any help please thanks monty If you mean you want to enter 2001 in cell A1 and have "Omagh" magically appear in its place when you hit the return key, I don't think it can be done. However, if you enter 2001 in cell A1 and have a VLOOKUP formula in cell B1, with reference data stored elsewhere in the sprdsht, that is easily done. Monty How many substitutes do you have? You are probably best to set up a separate table with ...

Using VBA to automatically add a new date to my table?
I would like to have my table (perhaps through a form) automatically add a new record with the date, every 24 hours, starting at midnight, 24/7/365 How do I do that? Also, And how do I search my username VWP1, because I tried searching users, typed in my VWP1 username, and no records were found? VWP1 On Fri, 5 Mar 2010 08:23:02 -0800, VWP1 <VWP1@discussions.microsoft.com> wrote: >I would like to have my table (perhaps through a form) automatically add a >new record with the date, every 24 hours, starting at midnight, 24/7/365 >How do I do that? Why th...

Why is this question so hard ?
CRM 1.2 When we create a new product and open it again we can't change the unit group, only the unit, it is greyed out. Do we have to delete and recreate the product item or is there an explanation. We haven't created a pricelist because we don't use it in this solution. Does anyone have any ideas on this one, please ! Jack ...

Need VBA code that enters the F2 Key upon entering the Field
I am using Access 2000. I understand that simply by pressing the F2 key while the cursor is in that field, you can toggle Off and ON the highlighting for that field (textbox). Can someone explain the necessary VBA code to perform this action without the user's intervention? "nytwodees" <nytwodees@discussions.microsoft.com> wrote in message news:E128AC11-3153-4A50-9873-F3BFACAC91B1@microsoft.com... >I am using Access 2000. > > I understand that simply by pressing the F2 key while the cursor is in > that > field, you can toggle Off and ON th...