Click here to Skip to main content
15,921,212 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Thread Pin
Colin Angus Mackay25-Jan-04 13:34
Colin Angus Mackay25-Jan-04 13:34 
GeneralNewbie question Pin
Anonymous25-Jan-04 5:57
Anonymous25-Jan-04 5:57 
GeneralBackgroundimage of Treeview Pin
Member 84000225-Jan-04 2:12
Member 84000225-Jan-04 2:12 
Generalsetting register, associated file Pin
pnpfriend24-Jan-04 9:53
pnpfriend24-Jan-04 9:53 
GeneralStarting PowerPoint in a webbrowser control Pin
gregcost24-Jan-04 8:28
gregcost24-Jan-04 8:28 
GeneralChanging the color of a TabPage tab Pin
nvmoss24-Jan-04 3:09
nvmoss24-Jan-04 3:09 
GeneralRun an external application hidden Pin
gregcost23-Jan-04 7:03
gregcost23-Jan-04 7:03 
GeneralExcel feedback in VB6 Pin
clockit23-Jan-04 2:51
clockit23-Jan-04 2:51 
:(Hi all who know all

I have a problem in that I need to automate an excel spreadsheet with external data sources and update the data from a remote server. Problem is, this is a standard spreadsheet which I cannot (not allowed) change yet want to read certain data from it once it has updated.

Starting Excel and automating the update is not a problem (see code below). However, I need to know when the update is complete since I then have to extract specific data from this spreadsheet in my code in VB to use. How can I get feedback from Excel to say that the update is complete or alternatively pass execution to another piece of code once the update is done.

"Command1_Click" section of code works fine - its the "AfterRefresh" bit thats got me stumped since it don't work!!!!!!!! The "AfterRefresh" section apparently refers to a PivotTable according to the excel Help section but I am not using a PivotTable.

Any help would be GREATLY appreciated

Regards

Jeremy




Private Sub Command1_Click()

Set m_objExcel = Excel.Workbooks
Dim msExcelWorkbook As String

msExcelWorkbook = App.Path & "\ExcelReports\Update.xls"

m_objExcel.Open msExcelWorkbook
m_objExcel.Application.Visible = True

m_objExcel.Application.ActiveWorkbook.RefreshAll

End Sub




Private Sub ActiveWorkBook_AfterRefresh(Success As Boolean)
If Success = True Then
m_objExcel.Application.ActiveWorkbook.Save
m_objExcel.Application.ActiveWorkbook.Close
m_objExcel.Application.Quit
Call MsgBox("Refreshed all Data", vbOKOnly)
Else
' failed or was cancelled
End If
End Sub
GeneralRe: Excel feedback in VB6 Pin
-Dr_X-24-Jan-04 13:27
-Dr_X-24-Jan-04 13:27 
GeneralRe: Excel feedback in VB6 Pin
clockit26-Jan-04 2:23
clockit26-Jan-04 2:23 
GeneralRe: Excel feedback in VB6 Pin
-Dr_X-26-Jan-04 3:28
-Dr_X-26-Jan-04 3:28 
GeneralReading XML String into DataSet (VB.NET) Pin
Nic Rowan23-Jan-04 2:29
Nic Rowan23-Jan-04 2:29 
GeneralRe: Reading XML String into DataSet (VB.NET) Pin
Jim Taylor23-Jan-04 3:25
Jim Taylor23-Jan-04 3:25 
GeneralRe: Reading XML String into DataSet (VB.NET) Pin
Nic Rowan23-Jan-04 3:33
Nic Rowan23-Jan-04 3:33 
GeneralRe: Reading XML String into DataSet (VB.NET) Pin
Guillermo Rivero23-Jan-04 3:30
Guillermo Rivero23-Jan-04 3:30 
GeneralRe: Reading XML String into DataSet (VB.NET) Pin
Nic Rowan23-Jan-04 3:35
Nic Rowan23-Jan-04 3:35 
GeneralDrawing custom captions on forms Pin
cnurse22-Jan-04 23:38
cnurse22-Jan-04 23:38 
GeneralDisable pasting in a textbox Pin
Anonymous22-Jan-04 23:16
Anonymous22-Jan-04 23:16 
GeneralRe: Disable pasting in a textbox Pin
Hesham Amin24-Jan-04 4:01
Hesham Amin24-Jan-04 4:01 
GeneralRe: Disable pasting in a textbox Pin
Dave Kreskowiak24-Jan-04 4:15
mveDave Kreskowiak24-Jan-04 4:15 
QuestionHow to use RtlMOveMemory in VB.NET? Pin
tacoboy22-Jan-04 22:31
tacoboy22-Jan-04 22:31 
AnswerRe: How to use RtlMOveMemory in VB.NET? Pin
RJGCarey29-Jan-04 7:24
RJGCarey29-Jan-04 7:24 
Generalc1 truedbgrid Pin
house_anno22-Jan-04 22:25
house_anno22-Jan-04 22:25 
GeneralRe: c1 truedbgrid Pin
gpa200026-Jan-04 5:16
gpa200026-Jan-04 5:16 
GeneralImporting data from Excel to Access using VB6 Pin
Member 78800722-Jan-04 19:50
Member 78800722-Jan-04 19:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.