Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Installing .xla add-in via the registry

Could somebody tell me again what the most foolproof way is to install a
..xla add-in in Excel (ticked under Tools, Add-ins) via the registry.

If there really isn't a foolproof way I think it might be better to do it in
Excel itself via a little VB6 .exe file.


RBS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Installing .xla add-in via the registry

Bart,

It was all in that installer file I sent you a while back.

--
HTH

Bob Phillips

"RB Smissaert" wrote in message
...
Could somebody tell me again what the most foolproof way is to install a
.xla add-in in Excel (ticked under Tools, Add-ins) via the registry.

If there really isn't a foolproof way I think it might be better to do it

in
Excel itself via a little VB6 .exe file.


RBS



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Installing .xla add-in via the registry

Bob,

Yes, I thought of that, but wasn't that done via loading Excel (in memory)
via a VB6 .exe?
I want to try it via the registry via an INNO install file.
Was there a source file with it?
Will have a look at your file.

Bart



"Bob Phillips" wrote in message
...
Bart,

It was all in that installer file I sent you a while back.

--
HTH

Bob Phillips

"RB Smissaert" wrote in message
...
Could somebody tell me again what the most foolproof way is to install a
.xla add-in in Excel (ticked under Tools, Add-ins) via the registry.

If there really isn't a foolproof way I think it might be better to do it

in
Excel itself via a little VB6 .exe file.


RBS




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Installing .xla add-in via the registry

I'll try and dig out the file and post the source to you.

Regards

Bob


"RB Smissaert" wrote in message
...
Bob,

Yes, I thought of that, but wasn't that done via loading Excel (in memory)
via a VB6 .exe?
I want to try it via the registry via an INNO install file.
Was there a source file with it?
Will have a look at your file.

Bart



"Bob Phillips" wrote in message
...
Bart,

It was all in that installer file I sent you a while back.

--
HTH

Bob Phillips

"RB Smissaert" wrote in message
...
Could somebody tell me again what the most foolproof way is to install

a
.xla add-in in Excel (ticked under Tools, Add-ins) via the registry.

If there really isn't a foolproof way I think it might be better to do

it
in
Excel itself via a little VB6 .exe file.


RBS






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Installing .xla add-in via the registry

Thanks Bob.


I have persisted with a registry install for a long time, but finally
decided that it just wasn't reliable enough.
This was my registry routine. It is in an INNO script, but you will
understand.


procedure setExcelVariables;
var
strExcelVersion : String;
iDotPos1 : Integer;
i : Integer;

// for getting the Office version and the path to Excel like this:
// C:\Program Files\Microsoft Office\Office10\
// note that the Office version can be a non-integer number like 9.5
// -----------------------------------------------------------------

begin

RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\App
Paths\Excel.exe',
'Path',
strPathToExcel);

// this will be file version of Excel.exe, something like 10.0.2.26
GetVersionNumbersString(strPathToExcel + 'EXCEL.EXE', strExcelVersion)

// Extract the registry version, such as 10.0
// ------------------------------------------------

// get the first dot
iDotPos1 := Pos('.', strExcelVersion);
i := iDotPos1 + 1;

// to find the second dot
While (strExcelVersion[i] < '.') and (i <= Length(strExcelVersion)) do
begin
i := i + 1
end;

// this will then be something like 10.0
strOfficeVersion := Copy(strExcelVersion, 1, i - 1);

end;



// Return the Subkey where the add-in should be added
// --------------------------------------------------
function GetAddInSubKey(Param: String): String;
begin
Result := 'Software\Microsoft\Office\' + strOfficeVersion + '\Excel\Add-in
Manager';
end;



// Return the Options Subkey
// -------------------------
function GetOptionsSubKey(Param: String): String;
begin
Result := 'Software\Microsoft\Office\' + strOfficeVersion +
'\Excel\Options';
end;



// Get the first available OPEN entry name
// ------------------------------------------------
function GetOPEN(Param : String): String;
var
i: Integer;
strValue : String;
strSubKey : String;
begin
strSubKey := 'Software\Microsoft\Office\' + strOfficeVersion +
'\Excel\Options';

if not RegQueryStringValue(HKEY_CURRENT_USER,
strSubKey,
'OPEN',
strValue) then
Result := '';
i := 1;

while RegQueryStringValue(HKEY_CURRENT_USER,
strSubKey,
'OPEN'+ IntToStr(i),
strValue) and
(Pos('synergyreportingloader.xla', Lowercase(strValue)) = 0) do
begin
i := i + 1;
End;

Result := 'OPEN' + IntToStr(i);
end;


This was the best I could come up with, but still I wasn't convinced it
would be foolproof.

Now do it simpley like this with a VB6 exe, a bit slower, but reliable:

Sub Main()

Dim oXL As Object
Dim oAddin As Object
Dim strLocalDrive As String

Set oXL = CreateObject("Excel.Application")

strLocalDrive = Left$(oXL.Path, 1)

oXL.Workbooks.Add
Set oAddin = _
oXL.AddIns.Add(strLocalDrive & _
":\RBSSynergyReporting\Program\SynergyReportingLoa der.xla",
True)
oAddin.Installed = True

oXL.Quit
Set oAddin = Nothing
Set oXL = Nothing

End Sub


Looking at your installer .ini file you use the registry and I will be
insterested to see how you did it.


RBS



"Bob Phillips" wrote in message
...
I'll try and dig out the file and post the source to you.

Regards

Bob


"RB Smissaert" wrote in message
...
Bob,

Yes, I thought of that, but wasn't that done via loading Excel (in
memory)
via a VB6 .exe?
I want to try it via the registry via an INNO install file.
Was there a source file with it?
Will have a look at your file.

Bart



"Bob Phillips" wrote in message
...
Bart,

It was all in that installer file I sent you a while back.

--
HTH

Bob Phillips

"RB Smissaert" wrote in message
...
Could somebody tell me again what the most foolproof way is to install

a
.xla add-in in Excel (ticked under Tools, Add-ins) via the registry.

If there really isn't a foolproof way I think it might be better to do

it
in
Excel itself via a little VB6 .exe file.


RBS







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
Value from Registry Roy Lasris Excel Programming 3 February 23rd 04 11:53 PM
System Registry Darryl Bailey Excel Programming 3 October 10th 03 03:47 PM
Registry Tom Ogilvy Excel Programming 1 July 16th 03 01:02 AM
Registry Patrick Molloy[_4_] Excel Programming 0 July 15th 03 12:45 PM


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