R
ryguy7272
How to save a WorkBook to SharePoint?
I Dimmed a WorkBook as such:
Dim SaveWB As Workbook
Now, I’m trying to assign a String to the WB and save it, as such:
SaveWB = imgElement.Title
SaveWB.Save
Application.EnableEvents = False
SaveWB.CheckIn True, "Update", True
Application.EnableEvents = True
‘imgElement.Title’ comes from SharePoint
Set imgElements = HTMLdoc.getElementsByTagName("img")
For Each imgElement In imgElements
…
Next
I keep getting an error that says ‘object variable or with block not
set’. I don’t know what the ‘imgElement.Title’ will be beforehand so
I have to create it dynamically.
Any ideas on how to assign this String to a WB?
This snippet of code works just fine:
If ThisWorkbook.CanCheckIn = True Then
MsgBox "Saving Changes and Checking your File into SharePoint
now!!"
ThisWorkbook.Save
Application.EnableEvents = False
ThisWorkbook.CheckIn True, "Update", True
Application.EnableEvents = True
End If
Thanks!
Ryan---
I Dimmed a WorkBook as such:
Dim SaveWB As Workbook
Now, I’m trying to assign a String to the WB and save it, as such:
SaveWB = imgElement.Title
SaveWB.Save
Application.EnableEvents = False
SaveWB.CheckIn True, "Update", True
Application.EnableEvents = True
‘imgElement.Title’ comes from SharePoint
Set imgElements = HTMLdoc.getElementsByTagName("img")
For Each imgElement In imgElements
…
Next
I keep getting an error that says ‘object variable or with block not
set’. I don’t know what the ‘imgElement.Title’ will be beforehand so
I have to create it dynamically.
Any ideas on how to assign this String to a WB?
This snippet of code works just fine:
If ThisWorkbook.CanCheckIn = True Then
MsgBox "Saving Changes and Checking your File into SharePoint
now!!"
ThisWorkbook.Save
Application.EnableEvents = False
ThisWorkbook.CheckIn True, "Update", True
Application.EnableEvents = True
End If
Thanks!
Ryan---