ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with VB Excel (https://www.excelbanter.com/excel-programming/330660-help-vbulletin-excel.html)

Lawrence M. Seldin, CMC, CPC

Help with VB Excel
 
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:

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

Tom Ogilvy

Help with VB Excel
 
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.

--
Regards,
Tom Ogilvy


"Lawrence M. Seldin, CMC, CPC" wrote in message
...
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:



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



George Nicholson[_2_]

Help with VB Excel
 
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,
--
George Nicholson

Remove 'Junk' from return address.


"Lawrence M. Seldin, CMC, CPC" wrote in message
...
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:


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





All times are GMT +1. The time now is 09:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com