473,608 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excell Interop Problem

Hi all,
My application allows you to create a new excel file and then double click
it in the list view to start it in excell. If the excell file is an existing
one then I can start it now problem.
The problem is when I create a new excel file in my application and try and
double click it excell starts and has the name of my newly created file
however doesn't show any sheets in the xls file.
If I shut down the computer and run my application and then double click the
xls file that wouldn't open properly b4, all is ok.
The code is below for the creation of the excell file.

Excel.Applicati onClass oExcelApp = new Excel.Applicati onClass();
Excel.Workbook oExcelDoc = oExcelApp.Workb ooks.Add(missin g);

//oExcelDoc.Activ ate();
TestName = this.Directory+ "NewWorkBoo k";
Num = 1;

while(File.Exis ts(TestName.ToS tring() + Num.ToString() + ".xls"))
{
Num++;
}

FileName = TestName.ToStri ng() + Num.ToString() + ".xls";
oExcelDoc.SaveA s(FileName, missing, missing, missing,
missing, missing,
Microsoft.Offic e.Interop.Excel .XlSaveAsAccess Mode.xlNoChange ,
missing, missing, missing, missing, missing);

oExcelDoc.Close ((bool)false,mi ssing,missing);

oExcelApp.Appli cation.Quit();
oExcelApp.Quit( );
ReleaseComObjec t((object)oExce lApp);

Anyone have any suggestions?
Cheers
Del
Jan 22 '06 #1
0 1100

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

Similar topics

0
1246
by: Franky | last post by:
I would like to create a new blank excel and set some header columns for the user. I try this code. It's work with Excel 2003 English but a got a error line 2 with all other version. (Excel 2003 french, Excel 2000, etc.) --- Dim oExcel As New Microsoft.Office.Interop.Excel.Application Dim oBook As Microsoft.Office.Interop.Excel.Workbook Dim IsNewBook As Boolean = False
2
1368
by: Robert Halstead | last post by:
Hi guys, I have a asp.net web app and it's connecting to an excell 2003 document (in another folder) via OleDataAdapter. Everything works and all, it's just that when I shutdown IE and try to access the excell document, asp.net seems to still keep it and won't release it. Excell gives some error saying it can't access it, but It's when I terminate the asp.net process in the task manager that the file is then released. I'm wanting to...
2
7290
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a "Array index out of bounds". Microsoft.Office.Interop.Outlook._Application olApp = new Microsoft.Office.Interop.Outlook.ApplicationClass(); Microsoft.Office.Interop.Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
2
2034
seshu
by: seshu | last post by:
hi every body This is seshu i have doubt in mysql i have some date in excell sheet to export that data i have copied all the data into a text file and the wrote this code in mysql editor LOAD DATA LOCAL INFILE 'pet.txt' INTO TABLE pet; it has been exported but now the problem is insted giveing my id no as id_0033 it is giving Id_0033along with a box suffixed to the id and this is only to last coumn why is it showing so...
2
2675
by: glibo | last post by:
I am trying to change the tab name when i open a excell spread sheet on the run time in c#. I changed it in the code: Response.AddHeader("content-disposition","filename=" + sFileName + ".xls"); But it works only on save mode but on the display mode still display the name of the page i am calling this excell spread sheet, in other words i see Ratings.aspx in url and in the tab name of this excell spread sheet. I need the name i assigned in the...
5
1124
by: Stephen Plotnick | last post by:
Public oexcel As Excel.Application Public obook As Excel.Workbook Public osheet As Excel.Worksheet The Excel.???? variables get not defined errors. Is there something I need to install on my VS 2005? Thanks, Steve
1
2280
by: thripurari | last post by:
Hi ! Dear all! I am getting a problem while binding the data source to the ultragrid . pls can any one could help me to bind the excell file to my ultra grid. My Question is: How to bind the data to the Ultragrid in windows application using C#.net, if the data source is either excell file or .XLS file? pls urgent. thanx anil kumar
2
1351
by: Bram2008 | last post by:
How to use macro in excel? Can i get some code to record excell data to vb? O y, i have project in vb, and i write data in vb, then i transfer it to excell to build chart. This is my code : Private Sub Command3_Click() Set ep = GetObject("C:\Documents and Settings\Byon 2007\My Documents\1.xls") Set ew = ep.sheets(1) ew.cells(1, 1) = Label15(0).Caption ew.cells(2, 1) = Label15(1).Caption
1
1457
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I m creating a database. The data for database will fetched from an excell sheet. Now how can i read an excell sheet and update my database with that excell sheet. Or I want to show all records of excell sheet in a listbox having a title of speecific text like "Names". Thanx >> ALI <<
0
8069
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8011
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8160
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8358
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6826
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6017
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3972
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.