LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default avoiding hang when formula is being edited

I posted the following a few days ago, but still have gotten no response. Trying again with more detail.

I'm embedding Excel in a VB app, and I've found that when the user is editing the formula in a cell, that certain automation calls hang - they bring up VB's Switch To/Retry/Cancel dialog. Is there any way to programmatically click the checkmark to get out of formula edit mode so that the document may manipulated?

To reproduce, create a form with a button and a webbrowser control. Add the following code. Then launch the app, wait while the spreadsheet is loaded, add some content, and while a formula is being edited (the x and checkmark next to the formula bar are visible), click the button. If the x and checkmark are not visible, then it will work, you can do something like set the button's caption to the activecell's formula if you like, but while the formula is being edited, this causes the hang. It had been suggested that this was due to asynchronous loading, but this is not the case. It is because Excel refuses certain automation calls while the formula is being edited.

Private Sub Command1_Click()
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet
Dim w As Excel.Window

Set wb = WebBrowser1.Document
Set ws = wb.ActiveSheet
Set w = wb.Windows(1)
End Sub

Private Sub Form_Load()
WebBrowser1.Navigate2 "file:///C:/test.xls"
End Sub



 
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
formula for spreadsheet, avoiding zeros? spezticle New Users to Excel 5 September 19th 08 04:12 AM
Application hang with array sum(sumif... formula klubar Excel Worksheet Functions 7 May 9th 07 04:31 PM
Formula do not work until edited KiwiSteve Excel Discussion (Misc queries) 12 November 8th 05 09:45 AM
Avoiding circular reference on formula Chuck W Excel Discussion (Misc queries) 4 February 22nd 05 02:52 AM
hang when formula bar open Stewart[_4_] Excel Programming 5 July 30th 04 08:07 AM


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

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"