VB script in Excel object in Powerpoint (Urgent)
I have a script in an excel object that I have put in powerpoint which I would like to run in powerpoint as an action (with a mouseclick) in slideshow mode.
Is there anyway to do this?
If that isn't possible, is it possible to make a macro in powerpoint that manipulates cells in an excel object?
Answer appreciated!
Am on a deadline, so a quick answer would be doubly appreciated!
Re: VB script in Excel object in Powerpoint (Urgent)
You can execute the pp show from Excel by first creating your pp slide show. Then its just a matter of shell executing the pp show. PP will be required on the system or have the susers download the PP Viewer utility.
Re: VB script in Excel object in Powerpoint (Urgent)
Thank you for your reply!
But, I am a little confused. How would I run a ppt file from excel? But how would it help me manipulate cells in an excel object embeded in powerpoint using powerpoint's action (mouseclick)?
What I want to do is have a table inside a ppt slideshow, and when I click on it with my mousebutton I want it to run the macro that I made to manipulate the cells inside the table.
I can't seem to access the vb modules I made for the table in excel, once embeded in the ppt file. Only if I click on the excel object table in powerpoint (not in slideshow mode, but in edit mode) will I be able to access the vb module. I don't know how all this works, but it seems that the module isn't "global" ?
Is there an "address" i can use for cells in an excel table embeded in powerpoint as an object? An "address" that I would be able to use to manipulate the cells in powerpoint?
Sorry for the repetition, I seem to have made it overly long!
Re: VB script in Excel object in Powerpoint (Urgent)
Oh I thought you just wanted to run the slideshow from Excel. If you want to manipulate excel from pp then you need to add a reference to excel inside pp in the Project > References menu. Then add your macro code to it and adjust where necessary. An "address" would be a cell or row/column. These are objects in Excel that you can access.
Re: VB script in Excel object in Powerpoint (Urgent)
I am really, really sorry, and I know it must be really tedious for you, but could you explain step by step how I would reference, and how I would change the code?
What would a sample address for a cell within an excel table embeded in powerpoint look like? An address that would work in a macro embeded in the powerpoint that can be used by a mouseover or mouseclick action?
I'm very sorry, but it's really urgent.. :)
I don't know if this is right, but under tools/references I checked Microsoft Excel 11 Object Library..
If that is right, now what would I have to do?
Is the address something like..
ActiveWindow.Selection.Workbook(1).Worksheets(1).Range("A1:B5") = "AB"
?
Re: VB script in Excel object in Powerpoint (Urgent)
Quote:
I don't know if this is right, but under tools/references I checked Microsoft Excel 11 Object Library..
Yes, that is correct.
Yes, that is how you would change the value of a cell.
Re: VB script in Excel object in Powerpoint (Urgent)
But how would I find out the exact address of the cell??
I don't know what the address is!!
Please tell me how to find out the address!
I also thought of adding a button in the excel file.
Please, if you can, could you take a look at this sample file ?
How would I be able to get that button to work?
Re: VB script in Excel object in Powerpoint (Urgent)
Does that button already work in excel? What type of button is it? Inline shape, oleobject, etc.[/color]
Re: VB script in Excel object in Powerpoint (Urgent)
I have, er, no idea. I just put in that using the form-button and attached the macro to it. If you open the powerpoint file in edit mode.. and you double click the excel table, then you can actually click the button. But in slideshow mode, I cannot.
Creating a macro inside powerpoint and linking it to a mouseover/click action is preferable, but I have no idea how to find out the address of cells in the embeded excel table!
Re: VB script in Excel object in Powerpoint (Urgent)
If you know the procedure tha gets executed from the button click then just call that procedure.
Re: VB script in Excel object in Powerpoint (Urgent)
I am really really sorry, but I am a total newbie..
I have no idea how to call that procedure.
But wouldn't I need the address of that "button procedure" to be able to "call" it from a powerpoint macro?
The thing is, I have no idea how to find out the address of that button, the procedure, the macro, everything that is related to that excel file embeded in the powerpoint file..
How do I find out the address?!
Re: VB script in Excel object in Powerpoint (Urgent)
Go into Excel and open that workbook. Then press Alt+F11 to open the VBA IDE. Then look in the Modules folder for your module code that should be named after your button with the "_Click()" after it.
Re: VB script in Excel object in Powerpoint (Urgent)
Mmm, there isn't any code for the button in my modules folder... only code that I've written. Would there be code for a form button made in excel that attaches to a macro you've written?
But you seem to be asking me to find out the name of the button?
Don't I need to find out the address of the button, not simply it's name?
Whereas an "address" as Worksheet(1).Cell(1,1) works when I am editing the file in excel, it won't work if i'm editing the powerpoint file with the excel file embeded in it...
Could you please take a look at the sample file and tell me how I can use that button or use the script attached to that button from within powerpoint?
As always, I am very grateful that you are helping me.. but I don't quite understand..
Re: VB script in Excel object in Powerpoint
I also tried doing this..
Code:
Sub bye()
With ActivePresentation.Slides(1).Shapes(1).OLEFormat.Object.Application
.Workbooks(1).Worksheets(1).Range("B2:C6").Value = "AB"
End With
With ActivePresentation.Slides(1).Shapes("Object 11568").OLEFormat.Object.Application
.Workbooks(1).Worksheets(1).Range("B2:C6").Value = "AB"
End With
Print ActivePresentation.Slides(1).Shapes(1).Name
End Sub
but it doesn't seem to work..
and why is it that i'm not able to run this macro in design mode? (in the run macro window, the "run" button is greyed out. only the cancel, edit, and delete buttons are active.. why is this?)
anybody?
Re: VB script in Excel object in Powerpoint (Urgent)
I found your macro code imn the module of excel but there is no specification of which wsheet or workbook.
VB Code:
Range("E12").Select
ActiveCell.FormulaR1C1 = "1"
Range("M7").Select
ActiveCell.FormulaR1C1 = "2"
Range("AA27").Select
Re: VB script in Excel object in Powerpoint (Urgent)
finally! i got it to work!
first of all, i finally managed to find an address that worked!
second, it seems that you can't use .Select because in slideshow mode as there is nothing to select.
and last of all, that strange occurance where i couldn't actually run a macro even in edit/design mode.. it was because of the security setting set on high!!
though, for some reason, it takes quite a long time before the macro runs.. perhaps 3~5 seconds. not a terribly big deal (considering it never even ran..) but i wonder if there is any way to make it faster?
anyway, here's the sample file with the problem solved!
if you're still interested, that is - i can totally imagine that you are sick and tired of me!
and thank you RobDog88 - i really really appreciate all your help :)