Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open XLT for edit and set Addin to False
Using Office 2003 and Windows XP;
I need to use automation with late binding to open an Excel template (xlt) for editing AND set its Addin property to false. The code I have so far, with Tom Ogilvy's help is: Dim oXL as Object Dim oWB as Object Dim sFullName = "fully qualified path to my file.xlt" Set oXL = CreateObject("Excel.Application") oxl.EnableEvents = False Set oWB = oXL.Workbooks.Open(FileName:=sFullName, Editable:=True) The problem is, since the template's Addin property is set to TRUE you get an error that an addin cannot be opened for editing. I suspect this is not possible, but if this is possible, could someone please post example code and/or correct mine above to deal with it? Thanks much in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open XLT for edit and set Addin to False
If it is an addin, then I wouldn't think it is also a template regardless of
the extension. Open it as is without the Edit command and it should load as an addin. Or load it as an addin. Once loaded, you should be able to edit the file with your code without changing the isAddin property. this is sample code showing how to load an addin Sub SolverInstall() '// Dana DeLouis Dim wb As Workbook On Error Resume Next ' Set a Reference to the workbook that will hold Solver Set wb = ActiveWorkbook With wb.VBProject.References .Remove .Item("SOLVER") End With With AddIns("Solver Add-In") .Installed = False .Installed = True wb.VBProject.References.AddFromFile .FullName End With End Sub -- Regards, Tom Ogilvy "XP" wrote: Using Office 2003 and Windows XP; I need to use automation with late binding to open an Excel template (xlt) for editing AND set its Addin property to false. The code I have so far, with Tom Ogilvy's help is: Dim oXL as Object Dim oWB as Object Dim sFullName = "fully qualified path to my file.xlt" Set oXL = CreateObject("Excel.Application") oxl.EnableEvents = False Set oWB = oXL.Workbooks.Open(FileName:=sFullName, Editable:=True) The problem is, since the template's Addin property is set to TRUE you get an error that an addin cannot be opened for editing. I suspect this is not possible, but if this is possible, could someone please post example code and/or correct mine above to deal with it? Thanks much in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Edit Sheets in Excel Addin | Excel Discussion (Misc queries) | |||
False 'Document is already open' error | Excel Programming | |||
False message .xla already open | Excel Programming | |||
How do I edit a worksheet that has been defined as an addin | Excel Discussion (Misc queries) | |||
cell value in edit mode with COM addin | Excel Programming |