gpt4 book ai didi

excel - 从 Powerpoint 关闭 Excel

转载 作者:行者123 更新时间:2023-12-04 20:55:34 25 4
gpt4 key购买 nike

我有以下代码,它打开一个 Excel 表格,执行我们的一些程序,然后关闭表格。

我无法关闭床单!

 Dim xlApp As Object
Dim xlWorkBook As Object
Dim path As String
Dim osh As Shape
Dim filename As String
Set xlApp = CreateObject("Excel.Application")


path = "path"
filename = "Name.xlsx"
xlApp.Visible = True
Set xlWorkBook = xlApp.Workbooks.Open(path & filename)
Set positionsheet = xlWorkBook.Sheets("Sheet1")
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation

'does stuff here

ActiveWindow.Visible = False

With xlApp ' I think the error is here!!!
.xlWorkBook.Save
.xlWorkBook.Close
End With

由于某种原因,工作表没有关闭!有任何想法吗??

最佳答案

尝试使用这个:

xlworkbook.close

关于excel - 从 Powerpoint 关闭 Excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48316657/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com