Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
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
Edit Sheets in Excel Addin Tim879 Excel Discussion (Misc queries) 2 November 28th 07 05:00 PM
False 'Document is already open' error kirkm[_6_] Excel Programming 0 October 20th 06 12:46 PM
False message .xla already open RB Smissaert Excel Programming 6 July 12th 06 08:58 AM
How do I edit a worksheet that has been defined as an addin Guy Normandeau Excel Discussion (Misc queries) 3 June 30th 06 07:00 PM
cell value in edit mode with COM addin Julian Tucker Excel Programming 0 September 7th 04 11:51 AM


All times are GMT +1. The time now is 10:26 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"