By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

What are parameters for Workbooks.Open() Using Interop.Excel?

P: n/a
Hello.

I am using Microsoft.Office.Interop.Excel in a C# .NET project. I want to
open an Excel application with a specific file name.

I am currently opening it with this code:

oXL.Workbooks.Open(src, Type.Missing, true, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

However, if I happen to open a file created with an older version of Excel,
I get a message prompt asking me if I want to save the changes to the file.
"Microsoft Office Excel recalculates formulas when opening files last saved
by an earlier version of Excel".

Since I am using automation, I don't want command prompts to appear during
my program.

I was hoping that the arguments to Open() would take care of that. However,
I have done a lot of searching on the topic and have found no documentation
about what each of the parameters mean.

From that, I have two questions for this newsgroup:

1) Can someone explain what each of those 15 or so parameters for Open()
mean or can point to a URL that identifies those?

2) What is the best way to ensure no prompts pop up when using automation in
C# .NET with Excel?

Thanks in advance.

-Sarah
Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Sarah,

"Sarah" <Sa***@discussions.microsoft.com> schrieb
I am using Microsoft.Office.Interop.Excel in a C# .NET project. I want to
open an Excel application with a specific file name.

I am currently opening it with this code:

oXL.Workbooks.Open(src, Type.Missing, true, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

However, if I happen to open a file created with an older version of
Excel,
I get a message prompt asking me if I want to save the changes to the
file.
"Microsoft Office Excel recalculates formulas when opening files last
saved
by an earlier version of Excel".

Since I am using automation, I don't want command prompts to appear during
my program.

I was hoping that the arguments to Open() would take care of that.
However,
I have done a lot of searching on the topic and have found no
documentation
about what each of the parameters mean.

From that, I have two questions for this newsgroup:

1) Can someone explain what each of those 15 or so parameters for Open()
mean or can point to a URL that identifies those?
The Excel 11 Object Model is located here:
http://msdn.microsoft.com/library/en...xltocOMMap.asp

A deep discussion of every single parameter is located here:
http://msdn.microsoft.com/library/en...xlmthOpen1.asp
(click on "Open method as it applies to the Workbooks object")

Good and useful collection of How-to's:
http://msdn.microsoft.com/library/en...bjectmodel.asp
2) What is the best way to ensure no prompts pop up when using automation
in
C# .NET with Excel?


Application.DisplayAlerts = false
should solve your problem.

Cheers

Arne Janning
Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.