Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default VBA script ActiveX .ocx embedded

Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC, I am
trying to come up with a way of embedded the file in the spreadsheet so that
as soon as the spreadsheet opens, it will allow the file to be moved (or
copied) to the right directory and then register the component automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA script ActiveX .ocx embedded

Mary,

I think you will have to work on a more reliable approach. In theory it
would be possible to have the winsock file on a server, use late binding
with an error trap, and if the file doesn't exist download it to the target
then register it with a shell call to regsvr. This is not trivial and is
likely to run into permissioning problems trying to register the ocx file.

I'd have a look at a very simple installation package that will register the
ocx on the target machine as part of your original distribution. Your best
option is probably the Visual Studio Installer. Just add the ocx to the
install package and it should self-register. Again, you will have to ensure
that you have adequate rights to install the ocx, but you can tell the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could you
achieve the same thing using IE or an api call like URLDownloadToFile? If so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC, I am
trying to come up with a way of embedded the file in the spreadsheet so
that
as soon as the spreadsheet opens, it will allow the file to be moved (or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default VBA script ActiveX .ocx embedded

Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I thought
that maybe if I can attach that component to my spreadsheet or include that
component in the zip package, when I either open the spreadsheet or the zip
package it would automatically include this file into the window folder and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this Visual Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In theory it
would be possible to have the winsock file on a server, use late binding
with an error trap, and if the file doesn't exist download it to the target
then register it with a shell call to regsvr. This is not trivial and is
likely to run into permissioning problems trying to register the ocx file.

I'd have a look at a very simple installation package that will register the
ocx on the target machine as part of your original distribution. Your best
option is probably the Visual Studio Installer. Just add the ocx to the
install package and it should self-register. Again, you will have to ensure
that you have adequate rights to install the ocx, but you can tell the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could you
achieve the same thing using IE or an api call like URLDownloadToFile? If so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC, I am
trying to come up with a way of embedded the file in the spreadsheet so
that
as soon as the spreadsheet opens, it will allow the file to be moved (or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA script ActiveX .ocx embedded

Mary,

I didn't say it was impossible, but it is impractical. If you really want to
try it, you will have to create an Object to hold the winsock reference, use
late binding with an error trap if you can't create the winsock object, have
a server somewhere to access to get the file, download the file, register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at least
part of VS first or it won't run, which may count this out as an option for
you. There may be other installers that you can use given how simple your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find an
alternative installer, you will need to figure out how to get the winsock
ocx on to the client machine, then use a command like this to register it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder & "Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or include
that
component in the zip package, when I either open the spreadsheet or the
zip
package it would automatically include this file into the window folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In theory it
would be possible to have the winsock file on a server, use late binding
with an error trap, and if the file doesn't exist download it to the
target
then register it with a shell call to regsvr. This is not trivial and is
likely to run into permissioning problems trying to register the ocx
file.

I'd have a look at a very simple installation package that will register
the
ocx on the target machine as part of your original distribution. Your
best
option is probably the Visual Studio Installer. Just add the ocx to the
install package and it should self-register. Again, you will have to
ensure
that you have adequate rights to install the ocx, but you can tell the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could you
achieve the same thing using IE or an api call like URLDownloadToFile? If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC, I
am
trying to come up with a way of embedded the file in the spreadsheet so
that
as soon as the spreadsheet opens, it will allow the file to be moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default VBA script ActiveX .ocx embedded

Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't think I have
a problem moving the .ocx file into the right folder and registering, but my
biggest headache is putting the file into the client's PC, because the client
isn't very PC literate, that is why I need to make it as simple as possible
for the user, and not needing the user to download the file themselves. I
thought about zipping up the spread sheet with the .ocx file inside the same
zip file, so that when the person unzip then it would automatically move the
component from the unzipped directory into the window folder when the Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the Excel
sheet so that I can save myself the trouble having to zip up the files, the
client having to unzip the files, and any other implications that might lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you really want to
try it, you will have to create an Object to hold the winsock reference, use
late binding with an error trap if you can't create the winsock object, have
a server somewhere to access to get the file, download the file, register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at least
part of VS first or it won't run, which may count this out as an option for
you. There may be other installers that you can use given how simple your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find an
alternative installer, you will need to figure out how to get the winsock
ocx on to the client machine, then use a command like this to register it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder & "Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or include
that
component in the zip package, when I either open the spreadsheet or the
zip
package it would automatically include this file into the window folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In theory it
would be possible to have the winsock file on a server, use late binding
with an error trap, and if the file doesn't exist download it to the
target
then register it with a shell call to regsvr. This is not trivial and is
likely to run into permissioning problems trying to register the ocx
file.

I'd have a look at a very simple installation package that will register
the
ocx on the target machine as part of your original distribution. Your
best
option is probably the Visual Studio Installer. Just add the ocx to the
install package and it should self-register. Again, you will have to
ensure
that you have adequate rights to install the ocx, but you can tell the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could you
achieve the same thing using IE or an api call like URLDownloadToFile? If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC, I
am
trying to come up with a way of embedded the file in the spreadsheet so
that
as soon as the spreadsheet opens, it will allow the file to be moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA script ActiveX .ocx embedded

Mary,

If you want to try it, the code for a download might look something like
this but there are plenty of perils in this approach. n.b. I have not tested
this.

'API file download call
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String, _
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub TestForWinsock()
Dim WS As Object
Dim lReturn As Long
Dim lRegSvrReturn As Long
Dim strFullURL As String
Dim strLocation As String

'run this before you do anything else then try and use late binding for the
winsock
'there might be a problem with a withevents statement but I can't test it

On Error Resume Next
Set WS = CreateObject("MSWinsock.Winsock")
On Error GoTo 0

If WS Is Nothing Then

'uncomment the next two lines and set these two variables
'strfullurl = path to the winsock.ocx file on the net
'strLocation = path to save the file, presumably the system folder

'this assumes you can write a file to the system folder!
lReturn = URLDownloadToFile(0, strFullURL, strLocation, 0, 0)

'this ignores permissioning problems with registration!
If lReturn = 0 Then _
lRegSvrReturn = Shell("regsvr32.exe /s " & strLocation)

End If

Set WS = Nothing

End Sub

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't think I
have
a problem moving the .ocx file into the right folder and registering, but
my
biggest headache is putting the file into the client's PC, because the
client
isn't very PC literate, that is why I need to make it as simple as
possible
for the user, and not needing the user to download the file themselves. I
thought about zipping up the spread sheet with the .ocx file inside the
same
zip file, so that when the person unzip then it would automatically move
the
component from the unzipped directory into the window folder when the
Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the Excel
sheet so that I can save myself the trouble having to zip up the files,
the
client having to unzip the files, and any other implications that might
lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you really want
to
try it, you will have to create an Object to hold the winsock reference,
use
late binding with an error trap if you can't create the winsock object,
have
a server somewhere to access to get the file, download the file, register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at least
part of VS first or it won't run, which may count this out as an option
for
you. There may be other installers that you can use given how simple your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find an
alternative installer, you will need to figure out how to get the winsock
ocx on to the client machine, then use a command like this to register
it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder &
"Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or include
that
component in the zip package, when I either open the spreadsheet or the
zip
package it would automatically include this file into the window folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In theory
it
would be possible to have the winsock file on a server, use late
binding
with an error trap, and if the file doesn't exist download it to the
target
then register it with a shell call to regsvr. This is not trivial and
is
likely to run into permissioning problems trying to register the ocx
file.

I'd have a look at a very simple installation package that will
register
the
ocx on the target machine as part of your original distribution. Your
best
option is probably the Visual Studio Installer. Just add the ocx to
the
install package and it should self-register. Again, you will have to
ensure
that you have adequate rights to install the ocx, but you can tell the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could
you
achieve the same thing using IE or an api call like URLDownloadToFile?
If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC,
I
am
trying to come up with a way of embedded the file in the spreadsheet
so
that
as soon as the spreadsheet opens, it will allow the file to be moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default VBA script ActiveX .ocx embedded

Thanks heaps Robin!
I will definitely test this and get back to you!
One important question I forgot to ask you in the last message, what is late
binding???
Thanks heaps for all your help!
= )
Mary

"Robin Hammond" wrote:

Mary,

If you want to try it, the code for a download might look something like
this but there are plenty of perils in this approach. n.b. I have not tested
this.

'API file download call
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String, _
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub TestForWinsock()
Dim WS As Object
Dim lReturn As Long
Dim lRegSvrReturn As Long
Dim strFullURL As String
Dim strLocation As String

'run this before you do anything else then try and use late binding for the
winsock
'there might be a problem with a withevents statement but I can't test it

On Error Resume Next
Set WS = CreateObject("MSWinsock.Winsock")
On Error GoTo 0

If WS Is Nothing Then

'uncomment the next two lines and set these two variables
'strfullurl = path to the winsock.ocx file on the net
'strLocation = path to save the file, presumably the system folder

'this assumes you can write a file to the system folder!
lReturn = URLDownloadToFile(0, strFullURL, strLocation, 0, 0)

'this ignores permissioning problems with registration!
If lReturn = 0 Then _
lRegSvrReturn = Shell("regsvr32.exe /s " & strLocation)

End If

Set WS = Nothing

End Sub

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't think I
have
a problem moving the .ocx file into the right folder and registering, but
my
biggest headache is putting the file into the client's PC, because the
client
isn't very PC literate, that is why I need to make it as simple as
possible
for the user, and not needing the user to download the file themselves. I
thought about zipping up the spread sheet with the .ocx file inside the
same
zip file, so that when the person unzip then it would automatically move
the
component from the unzipped directory into the window folder when the
Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the Excel
sheet so that I can save myself the trouble having to zip up the files,
the
client having to unzip the files, and any other implications that might
lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you really want
to
try it, you will have to create an Object to hold the winsock reference,
use
late binding with an error trap if you can't create the winsock object,
have
a server somewhere to access to get the file, download the file, register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at least
part of VS first or it won't run, which may count this out as an option
for
you. There may be other installers that you can use given how simple your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find an
alternative installer, you will need to figure out how to get the winsock
ocx on to the client machine, then use a command like this to register
it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder &
"Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or include
that
component in the zip package, when I either open the spreadsheet or the
zip
package it would automatically include this file into the window folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In theory
it
would be possible to have the winsock file on a server, use late
binding
with an error trap, and if the file doesn't exist download it to the
target
then register it with a shell call to regsvr. This is not trivial and
is
likely to run into permissioning problems trying to register the ocx
file.

I'd have a look at a very simple installation package that will
register
the
ocx on the target machine as part of your original distribution. Your
best
option is probably the Visual Studio Installer. Just add the ocx to
the
install package and it should self-register. Again, you will have to
ensure
that you have adequate rights to install the ocx, but you can tell the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could
you
achieve the same thing using IE or an api call like URLDownloadToFile?
If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC,
I
am
trying to come up with a way of embedded the file in the spreadsheet
so
that
as soon as the spreadsheet opens, it will allow the file to be moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA script ActiveX .ocx embedded

Non-exhaustive answer:

Early binding: setting a reference to the object using Tools References.
Late binding: using CreateObject as in the code below.

There's usually little difference, but if a class identifier might change -
e.g. I sometime unregister then re-register a couple of dlls I use as
libraries within VBA - then you are better off using the late binding since
it will find the more recently registered class.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Thanks heaps Robin!
I will definitely test this and get back to you!
One important question I forgot to ask you in the last message, what is
late
binding???
Thanks heaps for all your help!
= )
Mary

"Robin Hammond" wrote:

Mary,

If you want to try it, the code for a download might look something like
this but there are plenty of perils in this approach. n.b. I have not
tested
this.

'API file download call
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String,
_
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub TestForWinsock()
Dim WS As Object
Dim lReturn As Long
Dim lRegSvrReturn As Long
Dim strFullURL As String
Dim strLocation As String

'run this before you do anything else then try and use late binding for
the
winsock
'there might be a problem with a withevents statement but I can't test it

On Error Resume Next
Set WS = CreateObject("MSWinsock.Winsock")
On Error GoTo 0

If WS Is Nothing Then

'uncomment the next two lines and set these two variables
'strfullurl = path to the winsock.ocx file on the net
'strLocation = path to save the file, presumably the system folder

'this assumes you can write a file to the system folder!
lReturn = URLDownloadToFile(0, strFullURL, strLocation, 0, 0)

'this ignores permissioning problems with registration!
If lReturn = 0 Then _
lRegSvrReturn = Shell("regsvr32.exe /s " & strLocation)

End If

Set WS = Nothing

End Sub

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't think I
have
a problem moving the .ocx file into the right folder and registering,
but
my
biggest headache is putting the file into the client's PC, because the
client
isn't very PC literate, that is why I need to make it as simple as
possible
for the user, and not needing the user to download the file themselves.
I
thought about zipping up the spread sheet with the .ocx file inside the
same
zip file, so that when the person unzip then it would automatically
move
the
component from the unzipped directory into the window folder when the
Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the Excel
sheet so that I can save myself the trouble having to zip up the files,
the
client having to unzip the files, and any other implications that might
lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you really
want
to
try it, you will have to create an Object to hold the winsock
reference,
use
late binding with an error trap if you can't create the winsock
object,
have
a server somewhere to access to get the file, download the file,
register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at
least
part of VS first or it won't run, which may count this out as an
option
for
you. There may be other installers that you can use given how simple
your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find
an
alternative installer, you will need to figure out how to get the
winsock
ocx on to the client machine, then use a command like this to register
it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder &
"Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or
include
that
component in the zip package, when I either open the spreadsheet or
the
zip
package it would automatically include this file into the window
folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this
Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In
theory
it
would be possible to have the winsock file on a server, use late
binding
with an error trap, and if the file doesn't exist download it to
the
target
then register it with a shell call to regsvr. This is not trivial
and
is
likely to run into permissioning problems trying to register the
ocx
file.

I'd have a look at a very simple installation package that will
register
the
ocx on the target machine as part of your original distribution.
Your
best
option is probably the Visual Studio Installer. Just add the ocx to
the
install package and it should self-register. Again, you will have
to
ensure
that you have adequate rights to install the ocx, but you can tell
the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could
you
achieve the same thing using IE or an api call like
URLDownloadToFile?
If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up
a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their
PC,
I
am
trying to come up with a way of embedded the file in the
spreadsheet
so
that
as soon as the spreadsheet opens, it will allow the file to be
moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be
possible.

Thanks heaps!
Regards,
Mary











  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default VBA script ActiveX .ocx embedded

Hi Robin,

Do you mind explaining to me how the private method (URLDownloadToFile) work?

Thanks heaps!

Cheers,

Mary

"Robin Hammond" wrote:

Mary,

If you want to try it, the code for a download might look something like
this but there are plenty of perils in this approach. n.b. I have not tested
this.

'API file download call
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String, _
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub TestForWinsock()
Dim WS As Object
Dim lReturn As Long
Dim lRegSvrReturn As Long
Dim strFullURL As String
Dim strLocation As String

'run this before you do anything else then try and use late binding for the
winsock
'there might be a problem with a withevents statement but I can't test it

On Error Resume Next
Set WS = CreateObject("MSWinsock.Winsock")
On Error GoTo 0

If WS Is Nothing Then

'uncomment the next two lines and set these two variables
'strfullurl = path to the winsock.ocx file on the net
'strLocation = path to save the file, presumably the system folder

'this assumes you can write a file to the system folder!
lReturn = URLDownloadToFile(0, strFullURL, strLocation, 0, 0)

'this ignores permissioning problems with registration!
If lReturn = 0 Then _
lRegSvrReturn = Shell("regsvr32.exe /s " & strLocation)

End If

Set WS = Nothing

End Sub

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't think I
have
a problem moving the .ocx file into the right folder and registering, but
my
biggest headache is putting the file into the client's PC, because the
client
isn't very PC literate, that is why I need to make it as simple as
possible
for the user, and not needing the user to download the file themselves. I
thought about zipping up the spread sheet with the .ocx file inside the
same
zip file, so that when the person unzip then it would automatically move
the
component from the unzipped directory into the window folder when the
Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the Excel
sheet so that I can save myself the trouble having to zip up the files,
the
client having to unzip the files, and any other implications that might
lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you really want
to
try it, you will have to create an Object to hold the winsock reference,
use
late binding with an error trap if you can't create the winsock object,
have
a server somewhere to access to get the file, download the file, register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at least
part of VS first or it won't run, which may count this out as an option
for
you. There may be other installers that you can use given how simple your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find an
alternative installer, you will need to figure out how to get the winsock
ocx on to the client machine, then use a command like this to register
it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder &
"Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or include
that
component in the zip package, when I either open the spreadsheet or the
zip
package it would automatically include this file into the window folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In theory
it
would be possible to have the winsock file on a server, use late
binding
with an error trap, and if the file doesn't exist download it to the
target
then register it with a shell call to regsvr. This is not trivial and
is
likely to run into permissioning problems trying to register the ocx
file.

I'd have a look at a very simple installation package that will
register
the
ocx on the target machine as part of your original distribution. Your
best
option is probably the Visual Studio Installer. Just add the ocx to
the
install package and it should self-register. Again, you will have to
ensure
that you have adequate rights to install the ocx, but you can tell the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could
you
achieve the same thing using IE or an api call like URLDownloadToFile?
If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their PC,
I
am
trying to come up with a way of embedded the file in the spreadsheet
so
that
as soon as the spreadsheet opens, it will allow the file to be moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be possible.

Thanks heaps!
Regards,
Mary









  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA script ActiveX .ocx embedded

Mary,

It is a windows API call. I am not an expert on these things, but you just
need to specify the source of the file in the strURL variable, and where to
save it in strFileName. e.g. Put this in a general module. It should pull a
file off my site.

Option Explicit
Option Compare Text
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String, _
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub Demo()
Dim strURL As String
Dim strFileName As String
Dim lReturn As Long

strURL = "http://www.enhanceddatasystems.com/ED/Files/Progress Bar Class
97-03.xls"
strFileName = "C:\Temp\PBClass.xls"

lReturn = URLDownloadToFile(0, strURL, strFileName, 0, 0)

If lReturn = 0 Then
MsgBox "The file at:" & vbCrLf & strURL & _
vbCrLf & "Has been saved to:" & vbCrLf & strFileName
Else
MsgBox "Download failed"
End If
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi Robin,

Do you mind explaining to me how the private method (URLDownloadToFile)
work?

Thanks heaps!

Cheers,

Mary

"Robin Hammond" wrote:

Mary,

If you want to try it, the code for a download might look something like
this but there are plenty of perils in this approach. n.b. I have not
tested
this.

'API file download call
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String,
_
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub TestForWinsock()
Dim WS As Object
Dim lReturn As Long
Dim lRegSvrReturn As Long
Dim strFullURL As String
Dim strLocation As String

'run this before you do anything else then try and use late binding for
the
winsock
'there might be a problem with a withevents statement but I can't test it

On Error Resume Next
Set WS = CreateObject("MSWinsock.Winsock")
On Error GoTo 0

If WS Is Nothing Then

'uncomment the next two lines and set these two variables
'strfullurl = path to the winsock.ocx file on the net
'strLocation = path to save the file, presumably the system folder

'this assumes you can write a file to the system folder!
lReturn = URLDownloadToFile(0, strFullURL, strLocation, 0, 0)

'this ignores permissioning problems with registration!
If lReturn = 0 Then _
lRegSvrReturn = Shell("regsvr32.exe /s " & strLocation)

End If

Set WS = Nothing

End Sub

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't think I
have
a problem moving the .ocx file into the right folder and registering,
but
my
biggest headache is putting the file into the client's PC, because the
client
isn't very PC literate, that is why I need to make it as simple as
possible
for the user, and not needing the user to download the file themselves.
I
thought about zipping up the spread sheet with the .ocx file inside the
same
zip file, so that when the person unzip then it would automatically
move
the
component from the unzipped directory into the window folder when the
Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the Excel
sheet so that I can save myself the trouble having to zip up the files,
the
client having to unzip the files, and any other implications that might
lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you really
want
to
try it, you will have to create an Object to hold the winsock
reference,
use
late binding with an error trap if you can't create the winsock
object,
have
a server somewhere to access to get the file, download the file,
register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at
least
part of VS first or it won't run, which may count this out as an
option
for
you. There may be other installers that you can use given how simple
your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find
an
alternative installer, you will need to figure out how to get the
winsock
ocx on to the client machine, then use a command like this to register
it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder &
"Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or
include
that
component in the zip package, when I either open the spreadsheet or
the
zip
package it would automatically include this file into the window
folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this
Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In
theory
it
would be possible to have the winsock file on a server, use late
binding
with an error trap, and if the file doesn't exist download it to
the
target
then register it with a shell call to regsvr. This is not trivial
and
is
likely to run into permissioning problems trying to register the
ocx
file.

I'd have a look at a very simple installation package that will
register
the
ocx on the target machine as part of your original distribution.
Your
best
option is probably the Visual Studio Installer. Just add the ocx to
the
install package and it should self-register. Again, you will have
to
ensure
that you have adequate rights to install the ocx, but you can tell
the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could
you
achieve the same thing using IE or an api call like
URLDownloadToFile?
If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up
a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their
PC,
I
am
trying to come up with a way of embedded the file in the
spreadsheet
so
that
as soon as the spreadsheet opens, it will allow the file to be
moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be
possible.

Thanks heaps!
Regards,
Mary













  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default VBA script ActiveX .ocx embedded

Hi Robin!
Thanks heaps for the explanations, and thank god I got the scripts to work,
so happy! Thank you very much!!!
Although I did have a problem when running the Macro...it seems to freeze or
take a long time to download the file, is there any way of speeding the
process?
Thanks you SO, SO Much!
= )
Mary

"Robin Hammond" wrote:

Mary,

It is a windows API call. I am not an expert on these things, but you just
need to specify the source of the file in the strURL variable, and where to
save it in strFileName. e.g. Put this in a general module. It should pull a
file off my site.

Option Explicit
Option Compare Text
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String, _
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub Demo()
Dim strURL As String
Dim strFileName As String
Dim lReturn As Long

strURL = "http://www.enhanceddatasystems.com/ED/Files/Progress Bar Class
97-03.xls"
strFileName = "C:\Temp\PBClass.xls"

lReturn = URLDownloadToFile(0, strURL, strFileName, 0, 0)

If lReturn = 0 Then
MsgBox "The file at:" & vbCrLf & strURL & _
vbCrLf & "Has been saved to:" & vbCrLf & strFileName
Else
MsgBox "Download failed"
End If
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi Robin,

Do you mind explaining to me how the private method (URLDownloadToFile)
work?

Thanks heaps!

Cheers,

Mary

"Robin Hammond" wrote:

Mary,

If you want to try it, the code for a download might look something like
this but there are plenty of perils in this approach. n.b. I have not
tested
this.

'API file download call
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String,
_
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub TestForWinsock()
Dim WS As Object
Dim lReturn As Long
Dim lRegSvrReturn As Long
Dim strFullURL As String
Dim strLocation As String

'run this before you do anything else then try and use late binding for
the
winsock
'there might be a problem with a withevents statement but I can't test it

On Error Resume Next
Set WS = CreateObject("MSWinsock.Winsock")
On Error GoTo 0

If WS Is Nothing Then

'uncomment the next two lines and set these two variables
'strfullurl = path to the winsock.ocx file on the net
'strLocation = path to save the file, presumably the system folder

'this assumes you can write a file to the system folder!
lReturn = URLDownloadToFile(0, strFullURL, strLocation, 0, 0)

'this ignores permissioning problems with registration!
If lReturn = 0 Then _
lRegSvrReturn = Shell("regsvr32.exe /s " & strLocation)

End If

Set WS = Nothing

End Sub

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't think I
have
a problem moving the .ocx file into the right folder and registering,
but
my
biggest headache is putting the file into the client's PC, because the
client
isn't very PC literate, that is why I need to make it as simple as
possible
for the user, and not needing the user to download the file themselves.
I
thought about zipping up the spread sheet with the .ocx file inside the
same
zip file, so that when the person unzip then it would automatically
move
the
component from the unzipped directory into the window folder when the
Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the Excel
sheet so that I can save myself the trouble having to zip up the files,
the
client having to unzip the files, and any other implications that might
lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you really
want
to
try it, you will have to create an Object to hold the winsock
reference,
use
late binding with an error trap if you can't create the winsock
object,
have
a server somewhere to access to get the file, download the file,
register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at
least
part of VS first or it won't run, which may count this out as an
option
for
you. There may be other installers that you can use given how simple
your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't find
an
alternative installer, you will need to figure out how to get the
winsock
ocx on to the client machine, then use a command like this to register
it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder &
"Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why I
thought
that maybe if I can attach that component to my spreadsheet or
include
that
component in the zip package, when I either open the spreadsheet or
the
zip
package it would automatically include this file into the window
folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this
Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In
theory
it
would be possible to have the winsock file on a server, use late
binding
with an error trap, and if the file doesn't exist download it to
the
target
then register it with a shell call to regsvr. This is not trivial
and
is
likely to run into permissioning problems trying to register the
ocx
file.

I'd have a look at a very simple installation package that will
register
the
ocx on the target machine as part of your original distribution.
Your
best
option is probably the Visual Studio Installer. Just add the ocx to
the
install package and it should self-register. Again, you will have
to
ensure
that you have adequate rights to install the ocx, but you can tell
the
client that they need to run the installer with admin priviliges.

An alternative thought? Do you have to use a winsock control. Could
you
achieve the same thing using IE or an api call like
URLDownloadToFile?
If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open up
a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on their
PC,
I
am
trying to come up with a way of embedded the file in the
spreadsheet
so
that
as soon as the spreadsheet opens, it will allow the file to be
moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be
possible.

Thanks heaps!
Regards,
Mary












  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA script ActiveX .ocx embedded

It's a synchronous call - you have to wait for the file to download. I think
my server is OK, so maybe it's your bandwidth? Pick a file on a well known
site and try testing that.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi Robin!
Thanks heaps for the explanations, and thank god I got the scripts to
work,
so happy! Thank you very much!!!
Although I did have a problem when running the Macro...it seems to freeze
or
take a long time to download the file, is there any way of speeding the
process?
Thanks you SO, SO Much!
= )
Mary

"Robin Hammond" wrote:

Mary,

It is a windows API call. I am not an expert on these things, but you
just
need to specify the source of the file in the strURL variable, and where
to
save it in strFileName. e.g. Put this in a general module. It should pull
a
file off my site.

Option Explicit
Option Compare Text
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As String,
_
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub Demo()
Dim strURL As String
Dim strFileName As String
Dim lReturn As Long

strURL = "http://www.enhanceddatasystems.com/ED/Files/Progress Bar Class
97-03.xls"
strFileName = "C:\Temp\PBClass.xls"

lReturn = URLDownloadToFile(0, strURL, strFileName, 0, 0)

If lReturn = 0 Then
MsgBox "The file at:" & vbCrLf & strURL & _
vbCrLf & "Has been saved to:" & vbCrLf & strFileName
Else
MsgBox "Download failed"
End If
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi Robin,

Do you mind explaining to me how the private method (URLDownloadToFile)
work?

Thanks heaps!

Cheers,

Mary

"Robin Hammond" wrote:

Mary,

If you want to try it, the code for a download might look something
like
this but there are plenty of perils in this approach. n.b. I have not
tested
this.

'API file download call
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal strURL As
String,
_
ByVal strFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub TestForWinsock()
Dim WS As Object
Dim lReturn As Long
Dim lRegSvrReturn As Long
Dim strFullURL As String
Dim strLocation As String

'run this before you do anything else then try and use late binding
for
the
winsock
'there might be a problem with a withevents statement but I can't test
it

On Error Resume Next
Set WS = CreateObject("MSWinsock.Winsock")
On Error GoTo 0

If WS Is Nothing Then

'uncomment the next two lines and set these two variables
'strfullurl = path to the winsock.ocx file on the net
'strLocation = path to save the file, presumably the system folder

'this assumes you can write a file to the system folder!
lReturn = URLDownloadToFile(0, strFullURL, strLocation, 0, 0)

'this ignores permissioning problems with registration!
If lReturn = 0 Then _
lRegSvrReturn = Shell("regsvr32.exe /s " & strLocation)

End If

Set WS = Nothing

End Sub

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Yeah I can see that it is going to be a bit of trouble, I don't
think I
have
a problem moving the .ocx file into the right folder and
registering,
but
my
biggest headache is putting the file into the client's PC, because
the
client
isn't very PC literate, that is why I need to make it as simple as
possible
for the user, and not needing the user to download the file
themselves.
I
thought about zipping up the spread sheet with the .ocx file inside
the
same
zip file, so that when the person unzip then it would automatically
move
the
component from the unzipped directory into the window folder when
the
Excel
sheet open (guess I will have to do this with VBA)...
But I wasn't sure if it is possible to embedded the file into the
Excel
sheet so that I can save myself the trouble having to zip up the
files,
the
client having to unzip the files, and any other implications that
might
lurk
in this method...

Thanks,
Mary

"Robin Hammond" wrote:

Mary,

I didn't say it was impossible, but it is impractical. If you
really
want
to
try it, you will have to create an Object to hold the winsock
reference,
use
late binding with an error trap if you can't create the winsock
object,
have
a server somewhere to access to get the file, download the file,
register
the file,....

The VS Installer is here

http://msdn.microsoft.com/vstudio/do.../download.aspx

However, having looked at the licensing, it looks like you need at
least
part of VS first or it won't run, which may count this out as an
option
for
you. There may be other installers that you can use given how
simple
your
installation is. Have a look on Tucows or something similar.

If you don't have VS and therefore can't use the VSI, and can't
find
an
alternative installer, you will need to figure out how to get the
winsock
ocx on to the client machine, then use a command like this to
register
it,
but once again you may run into rights problems.

strSystemFolder = 'path to system folder on target machine
lRegSvrReturn = Shell("regsvr32.exe /s " & strSystemFolder &
"Winsock.ocx")

Robin Hammond
www.enhanceddatasystems.com


"Mary" wrote in message
...
Hi Robin,
Thank you very much for your suggestions.
Unfortunaely it is a must that I use WinSOCK control. That is why
I
thought
that maybe if I can attach that component to my spreadsheet or
include
that
component in the zip package, when I either open the spreadsheet
or
the
zip
package it would automatically include this file into the window
folder
and
then trigger a registration to occur...
So I guess that this method is impossible?
Could you tell me where I can find more information about this
Visual
Studio
Installer?
Thanks for all your help!
Cheers,
Mary

"Robin Hammond" wrote:

Mary,

I think you will have to work on a more reliable approach. In
theory
it
would be possible to have the winsock file on a server, use late
binding
with an error trap, and if the file doesn't exist download it to
the
target
then register it with a shell call to regsvr. This is not
trivial
and
is
likely to run into permissioning problems trying to register the
ocx
file.

I'd have a look at a very simple installation package that will
register
the
ocx on the target machine as part of your original distribution.
Your
best
option is probably the Visual Studio Installer. Just add the ocx
to
the
install package and it should self-register. Again, you will
have
to
ensure
that you have adequate rights to install the ocx, but you can
tell
the
client that they need to run the installer with admin
priviliges.

An alternative thought? Do you have to use a winsock control.
Could
you
achieve the same thing using IE or an api call like
URLDownloadToFile?
If
so
you might be less likely to have a registration problem.

Robin Hammond
www.enhanceddatasystems.com

"Mary" wrote in message
...
Hi,
I am having a lot of trouble trying to allow my client to open
up
a
spreadsheet with an embedded winsoc.ocx component within.
Because my client doesn't have the component installed on
their
PC,
I
am
trying to come up with a way of embedded the file in the
spreadsheet
so
that
as soon as the spreadsheet opens, it will allow the file to be
moved
(or
copied) to the right directory and then register the component
automatically.
Can someone give me some idea as to whether this would be
possible.

Thanks heaps!
Regards,
Mary














  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA script ActiveX .ocx embedded

Hi Robin-

Given that I'm late binding URLMON, how do I go about specifying the UID
and PWD for a site that requires one? I can't seem to find any
documentation on this API...

Thanks,
Michael



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
ActiveX Medley1208 Excel Discussion (Misc queries) 0 May 30th 08 04:09 PM
How to set the selected state of an embedded ActiveX listbox [email protected] Excel Discussion (Misc queries) 1 February 5th 07 09:30 PM
ActiveX RedChequer Excel Discussion (Misc queries) 0 March 9th 05 11:05 PM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM
Embedded ActiveX controls Jack Clift Excel Programming 3 December 1st 03 01:36 AM


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