Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    4

    Unanswered: data gathering within VBA macro

    Hello,

    I have written VBA code that automates some data gathering and computation routines. The problem I have within VBA is that I do not know how to allow sufficient time for the data to be fed into the spreadsheets.

    To be more precise, my program does the following:
    1. Data is fed into the spreadsheet;
    2. A computation is performed; and
    3. The above two steps are repeated several times for different data.

    I have tried two things: a timer and a Do Until (no #N/A appears within the data set). However, Excel appears to compute only sequentially, and everything comes to a halt.

    I would truly appreciate your insight.

    Thanks,

    Nick

  2. #2
    Join Date
    Dec 2003
    Location
    Östersund Sweden
    Posts
    60
    Hi,

    Do You make any call to an external program in the VBA-procedure?
    If so then You need to use Win API with the following APIs:

    Code:
    Private Declare Function OpenProcess Lib "kernel32" ( _ 
          ByVal dwDesiredAccess As Long, _ 
          ByVal bInheritHandle As Long, _ 
          ByVal dwProcessId As Long) As Long 
     
    
    Private Declare Function GetExitCodeProcess Lib "kernel32" ( _ 
          ByVal lnghProcess As Long, _ 
          lpExitCode As Long) As Long  
    
    Private Const PROCESS_ALL_ACCESS = &H1F0FFF
    BTW, Excel can only work with one process at the time.

    Kind regards,
    Dennis
    Kind regards,
    Dennis

  3. #3
    Join Date
    Feb 2004
    Posts
    4
    Hi Dennis,

    Many thanks!

    I shall try this out right away.

    All the best,

    Nick





    Originally posted by Xl-Dennis
    Hi,

    Do You make any call to an external program in the VBA-procedure?
    If so then You need to use Win API with the following APIs:

    Code:
    Private Declare Function OpenProcess Lib "kernel32" ( _ 
          ByVal dwDesiredAccess As Long, _ 
          ByVal bInheritHandle As Long, _ 
          ByVal dwProcessId As Long) As Long 
     
    
    Private Declare Function GetExitCodeProcess Lib "kernel32" ( _ 
          ByVal lnghProcess As Long, _ 
          lpExitCode As Long) As Long  
    
    Private Const PROCESS_ALL_ACCESS = &H1F0FFF
    BTW, Excel can only work with one process at the time.

    Kind regards,
    Dennis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •