Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set a reference to a Workbook w/out opening the Workbook?
Does anyone know how to set a reference to a Workbook w/out opening
the Workbook? I am experimenting with the code below: SaveFile = Left(imgElement.Title, 27) '<-- This is a parsed string... Dim sPathTemp As String Dim BookName As String Set xlApp = New Excel.Application xlApp.Visible = True 'Set WB = xlApp.Workbooks.Open(sPath, , False) '< -- This opens the file; I DON'T want to open the file sPath = strpath & "/" & SaveFile BookName = Mid(sPath, InStrRev(sPath, "/") + 1) Set WB = Workbooks(Index:=BookName) xlApp.Workbooks.Application.CalculateFull Application.DisplayAlerts = False buildsavedest = URL & SaveFile 'sPath xlApp.Workbooks(SaveFile).SaveAs buildsavedest xlApp.Workbooks(SaveFile).CheckIn SaveChanges:=True, _ Comments:="" The code fails on this line: xlApp.Workbooks(SaveFile).SaveAs buildsavedest Error mssg is 'Subscript out of range'. The files are in SharePoint. Any ideas on how to resolve this? Thanks so much!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
lost reference to activesheet when opening workbook inside IE | Excel Programming | |||
when opening an Excel Workbook, another blank workbook also opens | Excel Discussion (Misc queries) | |||
How to make the opening of a workbook conditional upon the opening of another workbook | Excel Programming | |||
How to make opening of workbook conditional of opening of another workbook | Excel Programming | |||
Question for Experts: Opening workbook with workbook references | Excel Programming |