Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How to refresh an Excel workbook from VBA

I want to run a number of scenarios through a business model in Excel.

I have all my input values in an Access table and can load them into the
relevant cells of my Excel sheet through Access-VBA.

I can also pick the resulting values from my Excel sheet.

Only thing I need to do is to refresh the calculations as a result of my new
input.

How is that done from VBA?

I link to my Excel through this code:

Dim xlBook As Object
Set xlBook = xlApp.Workbooks.Open(path & "\" & filename, 0, True)

and then I can access cell values.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default How to refresh an Excel workbook from VBA

you can just add

Calculate

for the whole workbook, or
[Object.]Calculate

where the object can be worksheet or range

"RSunday" wrote:

I want to run a number of scenarios through a business model in Excel.

I have all my input values in an Access table and can load them into the
relevant cells of my Excel sheet through Access-VBA.

I can also pick the resulting values from my Excel sheet.

Only thing I need to do is to refresh the calculations as a result of my new
input.

How is that done from VBA?

I link to my Excel through this code:

Dim xlBook As Object
Set xlBook = xlApp.Workbooks.Open(path & "\" & filename, 0, True)

and then I can access cell values.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default How to refresh an Excel workbook from VBA

xlapp.Calculate

"RSunday" wrote:

I want to run a number of scenarios through a business model in Excel.

I have all my input values in an Access table and can load them into the
relevant cells of my Excel sheet through Access-VBA.

I can also pick the resulting values from my Excel sheet.

Only thing I need to do is to refresh the calculations as a result of my new
input.

How is that done from VBA?

I link to my Excel through this code:

Dim xlBook As Object
Set xlBook = xlApp.Workbooks.Open(path & "\" & filename, 0, True)

and then I can access cell values.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refresh pivot table in workbook A when changing a cell in workbook gildengorin Excel Worksheet Functions 2 March 17th 09 04:59 PM
How to refresh Share workbook in excel someone can see changes Dorothy Robitalle Excel Programming 4 May 22nd 06 02:21 PM
How to refresh a Excel workbook with pivot & ADO query report in batch mode Karen Middleton Excel Discussion (Misc queries) 1 April 29th 05 02:05 PM
How to refresh a Excel workbook with pivot & ADO query report in batch mode Karen Middleton Excel Programming 1 April 29th 05 02:05 PM
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) Anant[_2_] Excel Programming 1 August 6th 03 04:22 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"