Home · Compatibility Lists · Support Forums · FAQ · News Archive · Articles · Submit News/Upcoming News
NT Compatible
advertisement


Forum overview » Software » VB In MS Excell (1/1)

Reply New Poll

VB In MS Excell
Author Message
ViolentGreen
Senior Member


Posts: 556
Joined: 2003-03-28
Member No.: 19229
Icon 2003-09-18 16:33:17

I have this huge, long, nasty query embedded into an excell maco that pulls in data from ODBC connection. After the data arives, I want to make some modifications to the data.

I am trying to run the function to modify the data right after the connection is added with

With ActiveSheet.QueryTables.Add(Connection...
...
End With

Function()


The problem I am runnign into is that it tries to run the function before the data reaches Excell. Is there a way that I can tell the function to wait until the data transfer is complete to run?

Post #131334
Edit Quote Print Solution Plonk Delete
AlecStaar
Account Disabled


Posts: 51
From: A discrete point in the Space-Time continuum...
Joined: 2001-02-09
Member No.: 5224
Icon 2003-12-14 23:05:23

"I have this huge, long, nasty query embedded into an excell maco that pulls in data from ODBC connection. After the data arives, I want to make some modifications to the data.

I am trying to run the function to modify the data right after the connection is added with

With ActiveSheet.QueryTables.Add(Connection...
...
End With

Function()


The problem I am runnign into is that it tries to run the function before the data reaches Excell. Is there a way that I can tell the function to wait until the data transfer is complete to run?"


Possibly.... if you are directly loading this into a sheet in excel, check to see if a certain cell's contents are not still "" (or NULL).

That's your "start execution" flag... & if Excel's VBA sheet level object has a timer on it, there is your ticket... have it keep scanning for that empty cell content, & when it's NO LONGER EMPTY, run your macro from that timer.

Another way is to load the sheet to a file instead of directly into excel, & check its size (or even existence) with the same timer method.

My advice is lookup timers in Excel's VBA help... I had to do that in Access a ton of times, it exists for the form level object there & can be utilized in this manner.

If it does not exist for sheet or worksheet level objects in Excel, try an ActiveX control ->

http://activex.microsoft.com/controls/iexplorer/x86/ietimer.cab

APK

Post #134052
Edit Quote Print Solution Plonk Delete
ViolentGreen
Senior Member


Posts: 556
Joined: 2003-03-28
Member No.: 19229
Icon 2003-12-15 11:44:22

I have this huge, long, nasty query embedded into an excell maco that pulls in data from ODBC connection. After the data arives, I want to make some modifications to the data.

I am trying to run the function to modify the data right after the connection is added with

With ActiveSheet.QueryTables.Add(Connection...
...
End With

Function()


The problem I am runnign into is that it tries to run the function before the data reaches Excell. Is there a way that I can tell the function to wait until the data transfer is complete to run?

Possibly.... if you are directly loading this into a sheet in excel, check to see if a certain cell's contents are not still "" (or NULL).

That's your "start execution" flag... & if Excel's VBA sheet level object has a timer on it, there is your ticket... have it keep scanning for that empty cell content, & when it's NO LONGER EMPTY, run your macro from that timer.

Another way is to load the sheet to a file instead of directly into excel, & check its size (or even existence) with the same timer method.

My advice is lookup timers in Excel's VBA help... I had to do that in Access a ton of times, it exists for the form level object there & can be utilized in this manner.

If it does not exist for sheet or worksheet level objects in Excel, try an ActiveX control ->

http://activex.microsoft.com/controls/iexplorer/x86/ietimer.cab

APK

Wow.... Talk about flashback... I eventually got around it somehow, though I dont' remember how. It seems like there was an option in the Add member that would specify whether or not to run the query in the background. I can't remember if that did it or not. I much prefer controling the threads myself. Not a big fan of the VB here... The syntax is too lenient and unstructured for me. Not as much as AppleScript. I don't see how anyone can use it.

Post #134082
Edit Quote Print Solution Plonk Delete

Reply New Poll

Forum overview » Software » VB In MS Excell

Legend
View   View profile
Solved   Mark this post as solution (topic starter only)
Quote   Reply with quote to post
Edit   Edit post
Delete   Delete post (admin only)

Moderator: Open / Close / Bump / Delete / Move / Merge

All products mentioned are registered trademarks or trademarks of their respective owners.
© 1998-2009 Esselbach Internet Solutions - All Rights Reserved. Terms and privacy policy
Website powered by Esselbach Storyteller CMS System