Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Suppress "Disable/Enable Macros" and Query Refresh dialog on open | Excel Programming | |||
How to write a macro to open a file read-only? | Excel Programming | |||
Make excel open file without Read Only dialog | Excel Discussion (Misc queries) | |||
Suppress dialog while opening a write protected Excel document from VBS | Excel Programming | |||
Open file to write and read at the same time | Excel Programming |