Run-time error 438

zinah

Board Regular
Joined
Nov 28, 2018
Messages
179
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!
 

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
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.
 

zinah

Board Regular
Joined
Nov 28, 2018
Messages
179
Office Version
  1. 365
Platform
  1. Windows
It worked perfectly GREAT! Thanks a million for your usual support! :)
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,109,549
Messages
5,529,465
Members
409,883
Latest member
asharris90
Top