无法以编程方式将Excel工作簿签入Powerpoint [英] Cannot programatically checkin Excel workbook to Powerpoint

查看:107
本文介绍了无法以编程方式将Excel工作簿签入Powerpoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题已经解决了好几个星期,用尽了我所有的可用资源.

我正在工作的工作簿中有一个宏.该宏签出另一个电子表格(我要对其进行更改),然后应将其签回.当我运行宏时,它签出文件并打开它.然后,它进入签入子例程,但失败,并显示消息运行时错误1004,对象"_Workbook"的方法"CheckIn"失败.我尝试完全限定签入,但结果相同.下面宏中的代码.
任何帮助将不胜感激,因为我完全不知所措!
迈克

I have a problem that I have been working on for several weeks, exhausting all resources I have available.

I have a macro in the workbook that I am working in. The macro checks out a different spreadsheet (that I will want to make changes to) and then should check it back in. When I run the macro, it checks out the file and opens it. It then proceeds to the checkin subroutine, but fails with the message run-time error 1004 "Method ''CheckIn'' of object ''_Workbook'' failed. I tried fully qualifying the checkin, but have the same results. I am including the code from the macro below.
Any assistance would be greatly appreciated, as I am totally stumped!
Mike

Option Base 1
Public wb0 As Workbook
Public xlFile0 As String
Public FileName0 As String
Sub Automation_Vetting_Process()
 xlFile0 = "http:// ..." 'Actual SharePoint URL
 CheckoutFile (xlFile0)
 FileName0 = wb0.Name
 CheckinFile (FileName0)
End Sub
Sub CheckoutFile(FileName As String)
' Determine if workbook can be checked out
 If Application.Workbooks.CanCheckOut(xlFile0) Then
  Application.Workbooks.CheckOut xlFile0
  Set wb0 = Application.Workbooks.Open(xlFile0)
  MsgBox wb0.Name & " is checked out to you."
 Else
  MsgBox "You are unable to checkout the at this time."
 End If
End Sub
Sub CheckinFile(FileName As String)
' Determine if workbook can be checked in
 If Application.Workbooks(FileName).CanCheckIn = True Then
  Application.Workbooks(FileName).CheckIn SaveChanges:=True, Comments:="", MakePublic:=False
  MsgBox FileName & " was checked in."
 Else
  MsgBox "You are unable to checkin the " & FileName & " spreadsheet at this time."
 End If
End Sub

推荐答案

对于这则帖子的标题不正确,我深表歉意.应该是无法以编程方式将Excel工作簿签到Sharepoint.
I apologize for the incorrect title of this post. It should have been "Cannot programatically checkin Excel workbook to Sharepoint.


这篇关于无法以编程方式将Excel工作簿签入Powerpoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆