murathison
07-20-2016, 06:26 AM
Hi guys,
this my first post in this forum so please apologize any shortcomings..
I have a problem with opening an Excel document (same path as PowerPoint presentation) and closing it afterwards.
I always get the same message saying that an Object is required although I did initiate an object. (On the line Set xlWB.....)
Because I am quite new to VBA I would appreciate your help.
Please see my code below:
Sub mapa()
Dim ApXL As Object
Dim xlWB As Object
Dim xlWS As Object
Set ApXL = CreateObject("Excel.Application")
Set xlWB = ApXL.Workbooks.Open(FileName:=Presentation.Path & "\Feedback.xlsm")
ApXL.Visible = True
Set xlWS = xlWB.Worksheets("Feedback")
xlWS.Activate
.......
.......
.......
xlWB.Quit
xlWS.Quit
ApXL.Quit
Set xlWS = Nothing
Set x1WB = Nothing
Set ApXL = Nothing
Thank you very much in advance.
Saludos:yes
this my first post in this forum so please apologize any shortcomings..
I have a problem with opening an Excel document (same path as PowerPoint presentation) and closing it afterwards.
I always get the same message saying that an Object is required although I did initiate an object. (On the line Set xlWB.....)
Because I am quite new to VBA I would appreciate your help.
Please see my code below:
Sub mapa()
Dim ApXL As Object
Dim xlWB As Object
Dim xlWS As Object
Set ApXL = CreateObject("Excel.Application")
Set xlWB = ApXL.Workbooks.Open(FileName:=Presentation.Path & "\Feedback.xlsm")
ApXL.Visible = True
Set xlWS = xlWB.Worksheets("Feedback")
xlWS.Activate
.......
.......
.......
xlWB.Quit
xlWS.Quit
ApXL.Quit
Set xlWS = Nothing
Set x1WB = Nothing
Set ApXL = Nothing
Thank you very much in advance.
Saludos:yes