Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default How to save a WorkBook to SharePoint?

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---

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default How to save a WorkBook to SharePoint?

I don't have access to SharePoint and have never used it.
With that sterling recommendation in mind...

The SaveWB object has been declared but it has not been Set.
You need:
Set SaveWB = imgElement.Title
-Or-
More likely:
Set SaveWB = Workbooks(imgElement.Title)
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware





"ryguy7272"
wrote in message
...
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---

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving files to Sharepoint site: error 1004 (can't save file) Harry Excel Programming 2 March 23rd 10 07:07 PM
Sharing Workbook on SharePoint by many users and Save on SharePo Jay Excel Discussion (Misc queries) 0 August 28th 09 04:20 PM
Search SharePoint for Workbook carmjo005 Excel Programming 2 June 24th 09 10:13 PM
Macro to Save to Sharepoint Jay Gill Excel Programming 0 July 12th 07 08:18 PM
SharePoint instead of Share Workbook? Gregg Excel Discussion (Misc queries) 0 May 16th 05 11:58 PM


All times are GMT +1. The time now is 08:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"