Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Automatic updating

Hello,
I have a workbook that contains one worksheet that is used as a template for
OLE Automation. Through automation I insert a new worksheet at position 1 in
the worksheets collection, copy the worksheet that is used as a template,
and then update the inserted worksheet with data, also through automation.
My users want another worksheet in this workbook, placed at position 3 in
the worksheets collection that grabs data from the information that I place
in the worksheet that I update (as stated previously). These users would
like to have their worksheet updated automatically so I wrote them a little
function as follows:

Public Function MyCellValue(sCell As String)
On Error GoTo eh
Dim sht As Worksheet

Set sht = Worksheets.Item(1)
MyCellValue = sht.Range(sCell).Value

Exit Function
eh:
Debug.Print Err.Number; Err.Description
End Function

When we insert the following into a cell:
=MyCellValue("B8")

their worksheet updates as expected. However, it doesn't work once they've
placed all the function calls into the cell and then I open up the file and
insert the expected worksheet at position 1 and update the data. Can anybody
tell me how to make their worksheet update automatically when I open up the
file and update it? Excel is set to Automatically calculate on the
Calculation tab of the options dialog.

Any help would be much appreciated and I hope that I have been clear and
concise enough in my explaination.

Steve Long


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
Automatic updating Barb H Excel Worksheet Functions 0 February 12th 10 05:10 PM
automatic updating rayteach Charts and Charting in Excel 1 June 11th 09 11:10 AM
Automatic Updating of Graphs AR Charts and Charting in Excel 1 February 8th 07 05:12 AM
automatic updating sanders Excel Discussion (Misc queries) 0 July 27th 06 02:45 PM
Automatic updating of 2nd sheet from first fibregrid Excel Worksheet Functions 3 July 29th 05 02:37 PM


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

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

About Us

"It's about Microsoft Excel"