R
ryguy7272
I’m trying to save a file to SharePoint. This code works fine when
there are two Workbooks in the same instance of Excel:
SaveFile = Left(imgElement.Title, 27)
MsgBox "Saving changes to " & SaveFile & " and checking this file into
SharePoint now!!", vbSystemModal
Set WB = Workbooks(SaveFile)
WB.Activate
WB.CheckIn SaveChanges:=True, Comments:=""
WB.Close
When I have two instances of Excel, how can I reference the OTHER
Workbook in the OTHER instance of Excel?
I’m trying something like this:
SaveFile = Left(imgElement.Title, 27)
MsgBox "Saving changes to " & SaveFile & " and checking this file into
SharePoint now!!", vbSystemModal
Dim savepath As String
savepath = strPath & "/" & SaveFile
Dim GetActiveWB As String
GetActiveWB = ActiveWorkbook.path & "/" & SaveFile
Set wb = Workbooks(GetActiveWB)
wb.Activate
wb.CheckIn SaveChanges:=True, Comments:=""
wb.Close
Now, I’m getting a ‘subscript out of range’ message right here:
Set wb = Workbooks(GetActiveWB)
How can I reference this Workbook (variable is ‘SaveFile’) and save it
to SharePoint, from a different INSTANCE of Excel?
Thanks!!
Ryan---
there are two Workbooks in the same instance of Excel:
SaveFile = Left(imgElement.Title, 27)
MsgBox "Saving changes to " & SaveFile & " and checking this file into
SharePoint now!!", vbSystemModal
Set WB = Workbooks(SaveFile)
WB.Activate
WB.CheckIn SaveChanges:=True, Comments:=""
WB.Close
When I have two instances of Excel, how can I reference the OTHER
Workbook in the OTHER instance of Excel?
I’m trying something like this:
SaveFile = Left(imgElement.Title, 27)
MsgBox "Saving changes to " & SaveFile & " and checking this file into
SharePoint now!!", vbSystemModal
Dim savepath As String
savepath = strPath & "/" & SaveFile
Dim GetActiveWB As String
GetActiveWB = ActiveWorkbook.path & "/" & SaveFile
Set wb = Workbooks(GetActiveWB)
wb.Activate
wb.CheckIn SaveChanges:=True, Comments:=""
wb.Close
Now, I’m getting a ‘subscript out of range’ message right here:
Set wb = Workbooks(GetActiveWB)
How can I reference this Workbook (variable is ‘SaveFile’) and save it
to SharePoint, from a different INSTANCE of Excel?
Thanks!!
Ryan---