Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Unable to Copy Add-in To Library Error

Hello,
I have a Workbooks_Open macro that uses this code to look for a specific add
in.

Dim AddCount, AddNo As Integer
Dim vPath As String
AddCount = Application.AddIns.Count
If AddCount 0 Then
For AddNo = 1 To AddCount
If AddIns(AddNo).Name = "ERAC_TranslateAddIn.xla" Then
vPath = AddIns(AddNo).Path
Dim ChkFile$
ChkFile$ = Dir(vPath & "\ERAC_TranslateAddIn.xla")
If ChkFile = "ERAC_TranslateAddIn.xla" Then
AddIns("Erac_Translateaddin").Installed = True
Else
vPath = ""
End If
End If
Next AddNo
End If

If it is not found it uses this to add the add in.

AddIns.Add Filename:= _
"\\fscorp00\Corp_Public\Groups\Corporate
Accounting\AutoMonarch\Excel_Add_Ins\ERAC_Translat eAddIn.xla"

Some users get a run time error "Unable to copy add-in to library". Any idea
why that happens or what I can do about it? Is there anything special about
copying add ins?
Thanks,
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Unable to Copy Add-in To Library Error

Hello,

I've tested your code and meet an run-time error at [
AddIns("Erac_Translateaddin").Installed = True ]
Instead of that, How about using [ AddIns(AddNo).Installed = True ] ?

After testing, I have a success!!!!!


Best regards



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Unable to Copy Add-in To Library Error

John,
Is the file path identical for all users?
Maybe, some users changed where their files are stored?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"John Hutcins"

wrote in message
...
Hello,
I have a Workbooks_Open macro that uses this code to look for a specific add
in.

Dim AddCount, AddNo As Integer
Dim vPath As String
AddCount = Application.AddIns.Count
If AddCount 0 Then
For AddNo = 1 To AddCount
If AddIns(AddNo).Name = "ERAC_TranslateAddIn.xla" Then
vPath = AddIns(AddNo).Path
Dim ChkFile$
ChkFile$ = Dir(vPath & "\ERAC_TranslateAddIn.xla")
If ChkFile = "ERAC_TranslateAddIn.xla" Then
AddIns("Erac_Translateaddin").Installed = True
Else
vPath = ""
End If
End If
Next AddNo
End If

If it is not found it uses this to add the add in.

AddIns.Add Filename:= _
"\\fscorp00\Corp_Public\Groups\Corporate
Accounting\AutoMonarch\Excel_Add_Ins\ERAC_Translat eAddIn.xla"

Some users get a run time error "Unable to copy add-in to library". Any idea
why that happens or what I can do about it? Is there anything special about
copying add ins?
Thanks,
John
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Unable to Copy Add-in To Library Error

Is it possible that not all users have write access to the Library directory?

Tim

"John Hutcins" wrote in message ...
Hello,
I have a Workbooks_Open macro that uses this code to look for a specific add
in.

Dim AddCount, AddNo As Integer
Dim vPath As String
AddCount = Application.AddIns.Count
If AddCount 0 Then
For AddNo = 1 To AddCount
If AddIns(AddNo).Name = "ERAC_TranslateAddIn.xla" Then
vPath = AddIns(AddNo).Path
Dim ChkFile$
ChkFile$ = Dir(vPath & "\ERAC_TranslateAddIn.xla")
If ChkFile = "ERAC_TranslateAddIn.xla" Then
AddIns("Erac_Translateaddin").Installed = True
Else
vPath = ""
End If
End If
Next AddNo
End If

If it is not found it uses this to add the add in.

AddIns.Add Filename:= _
"\\fscorp00\Corp_Public\Groups\Corporate
Accounting\AutoMonarch\Excel_Add_Ins\ERAC_Translat eAddIn.xla"

Some users get a run time error "Unable to copy add-in to library". Any idea
why that happens or what I can do about it? Is there anything special about
copying add ins?
Thanks,
John



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Unable to Copy Add-in To Library Error

Thanks to everyone who has replied. I figured out what the immediate problem
is. Now I am trying to figure out if I can fix it through the program.

When this exicutes
AddIns.Add Filename:= _
"\\fscorp00\Corp_Public\Groups\Corporate
Accounting\AutoMonarch\Excel_Add_Ins\ERAC_Translat eAddIn.xla"
The user is asked if they want to copy the add in to their add in folder.
Our instructions are to answer "Yes". If a user answers "No" they set a
reference to the add in on our shared drive and then either other users get
an error message when they try to copy it because it is in use or Excel seems
to be unable to find and run the macro code in the addin from the shared
drive address. That may also be because someone has it open already.

My fix for insuring that each user gets an idividual copy is to use a file
scripting object to copy the file from our shared drive to a local drive only
accessible by that user such as "C:\temp" then use AddIns.Add on that file.

What I would also like to do is undo the addin already created that is
pointing to the shared drive file. If I do that through the Excel menu by
turning off he add in then using the Browse button to locate the local file
it resets fine. But, I can't seem to do the same thing via VBA code

I'm using
AddIns("Erac_Translateaddin").Installed = False
then
AddIns.Add Filename:="C:Temp\ERAC_TranslateAddIn.xla"
after the file scripting object copies the file there
then
AddIns("Erac_Translateaddin").Installed = True
This all runs but I still end up with the add in pointing to the old files
path. Am I getting it twice and need to look for more than one and use the
index number to refer to what I am turning on and off?

Thanks,
John

"Jim Cone" wrote:

John,
Is the file path identical for all users?
Maybe, some users changed where their files are stored?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"John Hutcins"

wrote in message
...
Hello,
I have a Workbooks_Open macro that uses this code to look for a specific add
in.

Dim AddCount, AddNo As Integer
Dim vPath As String
AddCount = Application.AddIns.Count
If AddCount 0 Then
For AddNo = 1 To AddCount
If AddIns(AddNo).Name = "ERAC_TranslateAddIn.xla" Then
vPath = AddIns(AddNo).Path
Dim ChkFile$
ChkFile$ = Dir(vPath & "\ERAC_TranslateAddIn.xla")
If ChkFile = "ERAC_TranslateAddIn.xla" Then
AddIns("Erac_Translateaddin").Installed = True
Else
vPath = ""
End If
End If
Next AddNo
End If

If it is not found it uses this to add the add in.

AddIns.Add Filename:= _
"\\fscorp00\Corp_Public\Groups\Corporate
Accounting\AutoMonarch\Excel_Add_Ins\ERAC_Translat eAddIn.xla"

Some users get a run time error "Unable to copy add-in to library". Any idea
why that happens or what I can do about it? Is there anything special about
copying add ins?
Thanks,
John

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
Can't Find Project or Library Error Vick Excel Discussion (Misc queries) 1 May 17th 08 12:25 PM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
VB Error Object Library Not Registered Karine Rivet Excel Discussion (Misc queries) 2 April 11th 06 07:13 PM
Unable to find project or library - Please help. krayten Excel Programming 2 February 1st 06 03:54 PM
Project-Library Error Lee Excel Programming 2 June 13th 05 02:43 PM


All times are GMT +1. The time now is 03:41 AM.

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"