Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Unable to set Installed Property of AddIn

I get this message so I just went to doing this when I load a file that I
wish to have the add-in loaded for:

Workbooks.Open Filename:="P:\Library\test\test.xla"

But now I get a run-time 1004 error: Method 'Open' of object 'Workbooks'
failed. I can't seem to get the addin to function exactly right. I am using
XL 2003 version ,b tw! Anyone have suggestions. I get error messages
sometimes when I load the added using the addin "ToolsAddins". Ideas what I
am doing wrong? Also, I wish the addin to load one any a dozen files is
loaded , but I wish leave the addin loaded as long as one of these files
remains active. ANy ideas on this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Unable to set Installed Property of AddIn

Sounds like the path and/or filename is wrong. Load the addin some other way
(double click, drag into Excel etc). Select it in the VBE's project
explorer, in the Immediate window (ctrl-g)

?thisworkbook.fullname

Afraid I could make sense of the rest of your post.

Regards,
Peter T

"Mike H." wrote in message
...
I get this message so I just went to doing this when I load a file that I
wish to have the add-in loaded for:

Workbooks.Open Filename:="P:\Library\test\test.xla"

But now I get a run-time 1004 error: Method 'Open' of object 'Workbooks'
failed. I can't seem to get the addin to function exactly right. I am
using
XL 2003 version ,b tw! Anyone have suggestions. I get error messages
sometimes when I load the added using the addin "ToolsAddins". Ideas
what I
am doing wrong? Also, I wish the addin to load one any a dozen files is
loaded , but I wish leave the addin loaded as long as one of these files
remains active. ANy ideas on this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Unable to set Installed Property of AddIn

Oh dear

Afraid I could make sense of the rest of your post.


should have read

Afraid I couldn't make sense of the rest of your post.

Peter T

"Peter T" <peter_t@discussions wrote in message
...
Sounds like the path and/or filename is wrong. Load the addin some other
way (double click, drag into Excel etc). Select it in the VBE's project
explorer, in the Immediate window (ctrl-g)

?thisworkbook.fullname

Afraid I could make sense of the rest of your post.

Regards,
Peter T

"Mike H." wrote in message
...
I get this message so I just went to doing this when I load a file that I
wish to have the add-in loaded for:

Workbooks.Open Filename:="P:\Library\test\test.xla"

But now I get a run-time 1004 error: Method 'Open' of object 'Workbooks'
failed. I can't seem to get the addin to function exactly right. I am
using
XL 2003 version ,b tw! Anyone have suggestions. I get error messages
sometimes when I load the added using the addin "ToolsAddins". Ideas
what I
am doing wrong? Also, I wish the addin to load one any a dozen files is
loaded , but I wish leave the addin loaded as long as one of these files
remains active. ANy ideas on this?





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Unable to set Installed Property of AddIn

Oops Too!

My last sentence:

Also, I wish the addin to load when any of a dozen files are loaded , but I
wish to leave the addin loaded as long as any one of these files remains
active. Any ideas on this?

In other words, if the user loads file1.xls then the add-in loads. Then the
user loads file2.xls and then the user unloads file1.xls. At this point, I
wish the addin to remain loaded. There is a list of files that would all
load the addin but only when the last of those specific files is unloaded
would I want to unload the addin. Ideas?


"Peter T" wrote:

Oh dear

Afraid I could make sense of the rest of your post.


should have read

Afraid I couldn't make sense of the rest of your post.

Peter T

"Peter T" <peter_t@discussions wrote in message
...
Sounds like the path and/or filename is wrong. Load the addin some other
way (double click, drag into Excel etc). Select it in the VBE's project
explorer, in the Immediate window (ctrl-g)

?thisworkbook.fullname

Afraid I could make sense of the rest of your post.

Regards,
Peter T

"Mike H." wrote in message
...
I get this message so I just went to doing this when I load a file that I
wish to have the add-in loaded for:

Workbooks.Open Filename:="P:\Library\test\test.xla"

But now I get a run-time 1004 error: Method 'Open' of object 'Workbooks'
failed. I can't seem to get the addin to function exactly right. I am
using
XL 2003 version ,b tw! Anyone have suggestions. I get error messages
sometimes when I load the added using the addin "ToolsAddins". Ideas
what I
am doing wrong? Also, I wish the addin to load one any a dozen files is
loaded , but I wish leave the addin loaded as long as one of these files
remains active. ANy ideas on this?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Unable to set Installed Property of AddIn

Here's one approach, untested so double check method & typos etc

On a sheet in the addin, name a range and type your file names.

' In a normal module

Function KeepMeOpen() As Boolean
Dim b As Boolean
Dim wb As Workbook
Dim vArr

' "Files" is an named range of cells in a column in this addin
' that contain file names

vArr = Range("Files")

For Each wb In Workbooks
For i = 1 To UBound(vArr)
If UCase(wb.Name) = UCase(vArr(i, 1)) Then
b = True
Exit For
End If
Next
If b Then Exit For
Next
KeepMeOpen = b

End Function

'' in ThisWorkbook module

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = KeepMeOpen
End Sub


One advantage of this approach is the Named range can be writtien or
modified programatically as well as new files added / deleted to the named
range in the addin. The code to do this can be in some other workbook. The
code would also need to save the addin. IOW, updateable without needing to
redistribute an amended addin or programatically write to the code-project.

Alternatively, if all your filenames have say the first part as something
unique, even simpler. No need to bother with the named range of file names,
just compare the unique part with open file names.

In other files, in their close event's close the addin
Workbooks("myAddinName.xla").Close

This should trigger the BeforeClose event in the addin, if "Canel" returns
True close will abort.

Like I say, totally untested so do report back.

Regards,
Peter T

PS, was it a file name error

"Mike H." wrote in message
...
Oops Too!

My last sentence:

Also, I wish the addin to load when any of a dozen files are loaded , but
I
wish to leave the addin loaded as long as any one of these files remains
active. Any ideas on this?

In other words, if the user loads file1.xls then the add-in loads. Then
the
user loads file2.xls and then the user unloads file1.xls. At this point,
I
wish the addin to remain loaded. There is a list of files that would all
load the addin but only when the last of those specific files is unloaded
would I want to unload the addin. Ideas?


"Peter T" wrote:

Oh dear

Afraid I could make sense of the rest of your post.


should have read

Afraid I couldn't make sense of the rest of your post.

Peter T

"Peter T" <peter_t@discussions wrote in message
...
Sounds like the path and/or filename is wrong. Load the addin some
other
way (double click, drag into Excel etc). Select it in the VBE's project
explorer, in the Immediate window (ctrl-g)

?thisworkbook.fullname

Afraid I could make sense of the rest of your post.

Regards,
Peter T

"Mike H." wrote in message
...
I get this message so I just went to doing this when I load a file that
I
wish to have the add-in loaded for:

Workbooks.Open Filename:="P:\Library\test\test.xla"

But now I get a run-time 1004 error: Method 'Open' of object
'Workbooks'
failed. I can't seem to get the addin to function exactly right. I
am
using
XL 2003 version ,b tw! Anyone have suggestions. I get error messages
sometimes when I load the added using the addin "ToolsAddins". Ideas
what I
am doing wrong? Also, I wish the addin to load one any a dozen files
is
loaded , but I wish leave the addin loaded as long as one of these
files
remains active. ANy ideas on this?








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
Subscript error in 2007 when testing if Addin is installed XP Excel Programming 5 May 1st 08 06:28 PM
Installed Addin file opens when it shouldn't Aaron Excel Discussion (Misc queries) 3 February 6th 08 11:13 PM
Installed property Rights tool, now I cant edit hyperlinks! Your Worst Newbmare Excel Discussion (Misc queries) 0 July 24th 07 07:50 PM
Unable to set installed property of addin polandjc Excel Programming 6 September 15th 05 02:29 PM
Unable to run Excel addin procedure from Word Amir Excel Programming 6 August 6th 05 12:48 AM


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