Run Macro from hidden sheet

Akashwani

Well-known Member
Joined
Mar 14, 2009
Messages
2,911
Good day I have the following Macro....

Code:
Sub Wright()
'
' Wright Macro
'
'
    ActiveSheet.Shapes("Object 5").Select
    Selection.Verb Verb:=xlPrimary
End Sub

What do I need to add to this so that the Macro will run when the sheet is hidden? The Macro runs an Embeded presentation, which I do not want to be visible in the workbook.

Thanks

Ak
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Maybe try:

Code:
    Worksheets("Sheet1").Shapes("Object 5").Verb Verb:=xlPrimary

Change the Worksheet reference to suit.
 
Upvote 0
Thanks for the reply Andrew.

I have changed my code to this....

Rich (BB code):
Sub Wright()
'
' Wright Macro
'
'
 Worksheets("Sheet1").Shapes("Object 5").Verb Verb:=xlPrimary
End Sub

I get the following error...

Run-time error '438':
Object doesn't support this property or method.

Highlighted is...

Worksheets("Sheet1").Shapes("Object 5").Verb Verb:=xlPrimary

Ak
 
Upvote 0
What kind of object is it? How about?

Code:
Worksheets("Sheet1").Shapes("Object 5").Object.Verb Verb:=xlPrimary
 
Upvote 0
No that didn't work either.

I have a PowerPoint presentation that I want to run (but have hidden) when a button is clicked.

Ak
 
Upvote 0
Hiya Andrew,
I'm Sorry I haven't replied sooner, W O R K got in my way.
If I understand your question correctly "Object 5" is....
=EMBED("Presentation","") This is what I want to run with the macro, BUT it must be on a hidden worksheet.

Ak
 
Upvote 0
Re: Run Macro from hidden sheet SOLVED

Good morning Andrew,

That is fantastic, thank you very much for your help.

Ak
:)
 
Upvote 0
hello-hello

i also have a hidden sheet. i want users to be able to search with the pop up box i have, but not be able to see the sheet from the "main sheet"

the code im using is this:

Public Sub Workbook_Open()
Dim datatoFind
Dim sheetCount As Integer
Dim counter As Integer
Dim currentSheet As Integer
On Error Resume Next
currentSheet = ActiveSheet.Index
datatoFind = InputBox("Please Type The Last Name of The Person You Are Searching For")
If datatoFind = "" Then Exit Sub
sheetCount = ActiveWorkbook.Sheets.Count
If IsError(CDbl(datatoFind)) = False Then datatoFind = CDbl(datatoFind)
For counter = 1 To sheetCount
Sheets(counter).Activate
Cells.Find(What:=datatoFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
If ActiveCell.Value = datatoFind Then Exit Sub
Next counter
If ActiveCell.Value <> datatoFind Then
MsgBox ("Value not found")
Sheets(currentSheet).Activate
End If
End Sub


help?
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,266
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top