Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-19-2022, 08:16 PM
soroush.kalantari soroush.kalantari is offline Need help in open a PowerPoint presentation form Excel and save it with different name Windows 10 Need help in open a PowerPoint presentation form Excel and save it with different name Office 2016
Competent Performer
Need help in open a PowerPoint presentation form Excel and save it with different name
 
Join Date: Jun 2021
Posts: 124
soroush.kalantari is on a distinguished road
Default Need help in open a PowerPoint presentation form Excel and save it with different name

I have written a macro, in a part of it, I want to open a PowerPoint presentation form Excel workbook and save it with a different name, but when running the code, the code encounters an error in the last line (PPTX.ActivePresentation.saveas Filename:="C:\Users\s.kalantari\Desktop\dailyrepor t01.PPTX")
, saying “Run time error 424, object required. (The part of Macro with this issue is as following:

Sub Saveas()
Dim objPPTX As Object
Set objPPTX = createobject("PowerPoint.Application")
objPPTX.Visible = True
objPPTX.Presentations.Open "C:\Users\s.kalantari\Desktop\14010127.pptx", Untitled:=msoTrue
PPTX.ActivePresentation.saveas Filename:="C:\Users\s.kalantari\Desktop\dailyrepor t01.PPTX"

End Sub

Another question I have is this: If I want to use an Excel cell value (a variable) for the new name of saved file, dose the following code can do job? (Assuming the first problem is solved and cell value is not empty).

Sub Saveas()
Dim objPPTX As Object
Dim cell01 As variant
Cell01=Range("A1").Value
Set objPPTX = createobject("PowerPoint.Application")
objPPTX.Visible = True
objPPTX.Presentations.Open "C:\Users\s.kalantari\Desktop\14010127.pptx", Untitled:=msoTrue
PPTX.ActivePresentation.saveas Filename:="C:\Users\s.kalantari\Desktop\&cell01&”. PPTX"
End Sub
Any help will be appreciated. Thanks in advance.
Reply With Quote
 

Tags
saveas



Similar Threads
Thread Thread Starter Forum Replies Last Post
Interactive chart link from Excel to PowerPoint presentation vili999 PowerPoint 0 04-13-2018 09:11 AM
Not able to Open/ save Excel Documents M S Bhurji Excel 2 05-16-2016 08:33 AM
open powerpoint 2011 presentation in PC jerryny PowerPoint 0 09-10-2014 03:42 PM
How can I save a macro in the PowerPoint 2007 default presentation mrayncrental PowerPoint 1 06-09-2014 06:13 AM
How do I auto-update the TODAY excel function within PowerPoint show presentation? Powerpoint100 PowerPoint 0 02-12-2013 01:45 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft