Run-time error 438

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a macro that build PowerPoint presentation from excel. And workbook that has several tabs and their names as below:

"It would take", "Themes_2", "Themes_1". When I tried to build the slides this is what happened:

"It would take" tab successfully built into .pptx but the rest of the tabs didn't work as I got run-time error 438. can you check my macro below and advise what should I do to fix?


Sub goDOit()
Sheets("It would take").Activate
Call build_it_in_PPTX ------ this worked


Sheets("Themes_2").Activate
Call Sheets("Themes_2").build_it_in_PPTX ----- this didn't work


Sheets("Themes_1").Activate
Call Sheets("Themes_1").build_it_in_PPTX ----- this didn't work


End Sub




Thank you!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
The error is because in the code of the sheet "Themes_2" you must have a macro with the name "build_it_in_PPTX".
If you only have a macro with the name "build_it_in_PPTX" then you should put like this:
Code:
Sheets("Themes_2").Activate
Call build_it_in_PPTX


I do not know what you have in the build_it_in_PPTX macro, but I guess it works with the active sheet.
 
Upvote 0
It worked perfectly GREAT! Thanks a million for your usual support! :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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