Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default C# open workbook and suppress Read/Write dialog

I'm using VS2005 C# to open a workbook invisible, import data from various
worksheets, process some data, then write back to the workbook. My problem is
that when I open the workbook in non-readonly mode, it errors when I try to
write to a cell. I made the workbook visible so I can see what's going on,
and it pops up a dialog with a button to Choose Read/Write for Editing. If I
click the button, my app works fine.
When I open the workbook I set the ReadOnly parm to false, the
IgnoreReadOnlyRecommended parm to true, and the Editable parm to true. I've
also set the Excel.DisplayAlerts to false:

Excel.Workbook obWb = obWorkBooks.Open(filePath, System.Type.Missing,
bReadOnly, System.Type.Missing, System.Type.Missing, System.Type.Missing,
true, System.Type.Missing, System.Type.Missing, !bReadOnly,
System.Type.Missing, System.Type.Missing, System.Type.Missing,
System.Type.Missing, System.Type.Missing);

So what else do I need to do to get this to open as editable with no user
interaction (i.e., with the workbook not visible)?

--
Scott B
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default C# open workbook and suppress Read/Write dialog

Anybody have some input on this? I really need to fix it.
--
Scott B


"Scott B" wrote:

I'm using VS2005 C# to open a workbook invisible, import data from various
worksheets, process some data, then write back to the workbook. My problem is
that when I open the workbook in non-readonly mode, it errors when I try to
write to a cell. I made the workbook visible so I can see what's going on,
and it pops up a dialog with a button to Choose Read/Write for Editing. If I
click the button, my app works fine.
When I open the workbook I set the ReadOnly parm to false, the
IgnoreReadOnlyRecommended parm to true, and the Editable parm to true. I've
also set the Excel.DisplayAlerts to false:

Excel.Workbook obWb = obWorkBooks.Open(filePath, System.Type.Missing,
bReadOnly, System.Type.Missing, System.Type.Missing, System.Type.Missing,
true, System.Type.Missing, System.Type.Missing, !bReadOnly,
System.Type.Missing, System.Type.Missing, System.Type.Missing,
System.Type.Missing, System.Type.Missing);

So what else do I need to do to get this to open as editable with no user
interaction (i.e., with the workbook not visible)?

--
Scott B

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
Suppress "Disable/Enable Macros" and Query Refresh dialog on open Sharon Excel Programming 2 January 18th 06 09:20 PM
How to write a macro to open a file read-only? Mark Seger Excel Programming 20 June 5th 05 05:31 PM
Make excel open file without Read Only dialog Saul Margolis Excel Discussion (Misc queries) 2 March 16th 05 03:30 PM
Suppress dialog while opening a write protected Excel document from VBS Stefan[_7_] Excel Programming 1 February 17th 04 12:47 PM
Open file to write and read at the same time Tom Ogilvy Excel Programming 2 September 22nd 03 01:10 PM


All times are GMT +1. The time now is 07:37 AM.

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"