Help with VB Excel

  • Thread starter Lawrence M. Seldin, CMC, CPC
  • Start date
L

Lawrence M. Seldin, CMC, CPC

The current code in VB Excel makes me "hard code" all of my datasources. Can someone help modify
this code so that any datasource that begins with the name of "$Auto_" with any name after the "_"
be updated.


Here is the VB Excel code:

// begin

Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Sub auto_open()
Dim WLE As WealthLab.WL3
Set WLE = New WealthLab.WL3
Sleep(5000)
Call WLE.WebUpdate("$Auto_DailyDataSource1")
Call WLE.WebUpdate("$Auto_WeeklyDataSource2")
Set WLE = Nothing
Application.Quit
End Sub

// end

Thanks much,

Lawrence M. Seldin, CMC, CPC
Author of POWER TIPS FOR THE APPLE NEWTON and INTRODUCTION TO CSP
Author of RECRUITSOURCE PEOPLESOFT EXAM and RECRUITSOURCE SAP/R3 EXAM


NOTE: To send me an email, remove TAKEOUT from my email address: (e-mail address removed)

NOTE: My web home page: www.seldin.net
 
T

Tom Ogilvy

I don't know how Wealthlab stores its files (if they are separate files and
if so how they are named), but if you can find them, you can perhaps loop
through the files using the sample code for the DIR command and get the
filename, then perhaps build you datasource argument from there.
 
G

George Nicholson

You *might* get a better response if you gave us a clue what object library
you are using that includes a WealthLab object and a WebUpdate method.

Otherwise, maybe it's as simple as the following? (assuming Datasources is a
collection)

For each ds in Datasources
If Left(ds.Name,6) = "$Auto_" Then
WLE.WebUpdate(ds.Name)
End If
Next ds

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top