473,498 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
1 17155
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6499
by: Derek Richards | last post by:
The following syntax is what I found under the Help in Excel's VBA Editor (you may refer to it for the details of each parameter). i specified to open in Write mode (Read Only is false), it...
1
651
by: Sarah | last post by:
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: ...
1
5876
by: Arunabh | last post by:
Hi I try uploading an excel in one of my ASP.NET application where I uplopad data from excel. I find the application works fine, as a whole but when I try to upload one particular excel, the...
3
2579
by: ABC | last post by:
What methods can export excel file from stored procedure with parameters which input from web form?
1
1751
by: Ishan Bhalla | last post by:
Hello, Am not sure if i have put this in the wrong discussion group. I have 2 workbooks with 1 worksheet each. I want to merge the workbooks into one. Any idea how to do it? I am using VB.net...
2
1816
by: cbs81 | last post by:
hi all, problem: transferring data from workbooks that are stored in a particular directory from excel to a table in access. when done, the workbooks that have been processed are automatically...
0
1903
by: wankhusairi | last post by:
hallo sir .. i am still new on using vb and i have tried to load an excel using a visual basic interface.. but if i wanted to plot my excel data what should i do.. must i cahnge my program on loading...
9
2752
by: QCLee | last post by:
Sir can you help me to transfer my Access Query to MS excel? i have a command button on the form to export the parameter query named "HVACWindwardQuery" to excel spreadsheet and i got the codes...
7
1836
by: Yesh | last post by:
I am a new bee to VBA. I have created an app which outputs the data from access to an Excel spread sheet and saves it. I have used the following snippet to perform that action. The following is the...
0
1590
by: Swys | last post by:
Hi there, I am currently trying to write myself a wrapper class for the Excel interop services. I had a problem on closing the process, but just decided to kill it in the end. My current problem,...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.