473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Excel backend code question

Guys
I am working with an excel workbook and have 99% complete however there is
one line that is keeping me from fully automating this proecess.
Code:
Excel.Application excelApp = new Excel.ApplicationClass();
Excel.Workbook excelWorkbook = excelApp.Workbooks._Open(excelFile, false,
false, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
object sheetFormat = Microsoft.Office.Interop.Excel.XlFileFormat.xlHtml ;
String outputFile = @"C:\Program\EnergyReport\EnergySheets.html";
// here is the line
excelWorkbook.SaveAs(outputFile, sheetFormat, Type.Missing, Type.Missing,
false, false, Excel.XlSaveAsAccessMode.xlNoChange,
Excel.XlSaveConflictResolution.xlLocalSessionChang es, false, Type.Missing,
Type.Missing, Type.Missing);

Where I do the "SaveAs" workbook I get a dialog pop-up window that informes
me that I will "lose my customer view, do I wish to continue" I always say
yes and from there on everything is fine.

How can I stop, or via code remove the user interaction with this dialog box?

Thanks
Mar 19 '07 #1
1 2115
Set
excelApp.DisplayAlerts = false;
before doing the saveAs.

Robin S.
-------------------------------------
"BrianDH" <Br*****@discussions.microsoft.comwrote in message
news:3A**********************************@microsof t.com...
Guys
I am working with an excel workbook and have 99% complete however there
is
one line that is keeping me from fully automating this proecess.
Code:
Excel.Application excelApp = new Excel.ApplicationClass();
Excel.Workbook excelWorkbook = excelApp.Workbooks._Open(excelFile, false,
false, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
object sheetFormat = Microsoft.Office.Interop.Excel.XlFileFormat.xlHtml ;
String outputFile = @"C:\Program\EnergyReport\EnergySheets.html";
// here is the line
excelWorkbook.SaveAs(outputFile, sheetFormat, Type.Missing, Type.Missing,
false, false, Excel.XlSaveAsAccessMode.xlNoChange,
Excel.XlSaveConflictResolution.xlLocalSessionChang es, false,
Type.Missing,
Type.Missing, Type.Missing);

Where I do the "SaveAs" workbook I get a dialog pop-up window that
informes
me that I will "lose my customer view, do I wish to continue" I always
say
yes and from there on everything is fine.

How can I stop, or via code remove the user interaction with this dialog
box?

Thanks

Mar 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Carl | last post by:
Please can anyone tell me how I can create a macro to save the results of a query as an excel file? The query is called Student List and I would like to save it to "My Documents". We have had...
7
by: robert d via AccessMonster.com | last post by:
I just imported 62000 rows twice from Excel. In my import routine, I create a holding table and then validate the data prior to committing to the main table. The holding table is created in the...
7
by: alwayssmiling | last post by:
Hi frends, In my application, a class supports backend processing. In this class im creating a new excel sheet and im inserting some data into this excel sheet, and im trying to save the file...
1
by: Tammy Viola | last post by:
I would like to import an Excel Worksheet as a new table in the backend of an Access database. Looked at using docmd.TransferSpreadsheet without success. Also looked at creating a table using...
3
Craash
by: Craash | last post by:
I understand this is an access forum so I apologize if this is inappropriate. I have an excel spreadsheet that I have created a query using a DSN to access a sql database. My question; is there a...
6
by: james.igoe | last post by:
I've been hired to produce a reporting database that takes data from numerous sources (5 financial products, from three regions, each with multiple tabs) and although I'm confident I can build...
7
by: farhaaad | last post by:
Hi everybody, I just wanted to know if i can make a form in excel (the same as access forms), so when i enter data in excel form it goes to a table in access ? I mean when i enter a value in a...
3
by: pleaseexplaintome_2 | last post by:
using the code below (some parts not included), I create a new excel workbook with spreadheets. I then want to delete a spreadsheet, but a reference remains open and excel stays in task manager...
18
by: PW | last post by:
Convert them to CSV in Excel, then use TransferText (which does not work correctly and also doesn't accept XLS/Excel files directly) or create a link to an Excel XLS workbook and do an Append Query...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.