PDA

View Full Version : [SOLVED:] Updating Project From Web-Site



johnske
01-17-2005, 07:53 PM
Hi all, can anyone help here?

I know if I play around with this long enough I should be able to crack it, but odds are someone here's already done it and if not, well, you know what they say about many hands....

We've all seen this in action with things like A/V programs - it's the check for updates thingie...

Now, let's say I have a VBA XL project I've called a WidgetV2.06 that I've sent to a few people and I've also posted it on my site so others can download it. If bugs are fixed or the Widget is improved I'll then re-post it, and/or any updated code modules there as WidgetV2.07 (or more).

Instead of telling the users to check the site regularly for updated versions it'd be better to include this as a "button-click" inside the Widget they have.

i.e. At the click of a button, we want to go to a web-site, check if there is a later version Widget or code module there, and if there is - remove the older code module from the Widget and import the updated one from the later version on the web-site.

Here's what I've got so far...

1) Connect to the web site:


Option Explicit
Public Declare Function ShowWindow& Lib "user32" ( _
ByVal hwnd As Long, _
ByVal nCmdShow As Long)

Sub BeamMeUpScotty()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
On Error GoTo 1
With ie
.navigate "http://www.geocities.com/(MySiteName)/" 'replace (MySiteName) with real site
.Visible = True
Call ShowWindow(.hwnd, 3)
End With
Set ie = Nothing
Exit Sub
1: MsgBox Err.Description
ie.Quit
Set ie = Nothing
End Sub

2) Import the new module (this is only from desktop tho - haven't tried to import it from site yet):


Sub ImportModule()
Application.VBE.ActiveVBProject.VBComponents.Import ("WidgetV2_07.bas")
End Sub
Now, a problem already - dunno why, but when I use similar code to the above to remove the old module I get a "type mismatch" error???

Paleo
01-17-2005, 08:33 PM
Why dont you create a WebService and just use it by Excel? This way the code would be always update, sure there would be a down point that your user would must be online everytime he/she needs your code.

johnske
01-17-2005, 09:03 PM
Why dont you create a WebService and just use it by Excel? This way the code would be always update, sure there would be a down point that your user would must be online everytime he/she needs your code.Hi Paleo,

Thanx for your reply, but that's not really an option in this case.

Regards,
John