473,387 Members | 1,561 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,387 software developers and data experts.

"file is now available" pop up crashing excel vb.net code

I have a porgram that opens an excel workbook and modifies some data, but
almost randomly a box will pop up in the workbook telling me the file is now
available and to hit ok or cancel. This crashes my program. Is there a way
to open the workbook so that it does not display this box? I open the
workbook as an object because some people here use office 2000 and some use
xp

'create the xl object
Dim xl As Object

xl = CreateObject("Excel.Application")

Dim xlwb As Object = xl.Workbooks.Open(TextBox2.Text, notify:=False)
....... I've also tried Dim xlwb As Object =
xl.Workbooks.Open(TextBox2.Text, notify:=False)

Dim xlws As Object = xlwb.Sheets(1)

xl.displayalerts = False

xl.interactive = False

xl.Visible = True

If I put a stop before the code that writes to the workbook, I can clear the
box after it pops up and the program then continues on.

Here is an example of the code I use to write to the worksheet. Seems pretty
standard to me

if xlws.Cells(1, 1).value <> "Machine name" Then

xlws.Range("A1").EntireRow.Insert()

xlws.Range("a1", "z1").Font.Bold = True

xlws.Cells(1, 1).value = "Machine name"

xlws.Cells(1, 2).value = "MS04-041"

xlws.Cells(1, 3).value = "MS04-043"

xlws.Cells(1, 4).value = "MS04-044"

xlws.Cells(1, 5).value = "MS05-001"

xlws.Cells(1, 6).value = "MS05-002"

xlws.Cells(1, 7).value = "MS05-003"

xlws.Cells(1, 8).value = "Reboot Status"

End If
Nov 21 '05 #1
0 1185

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

Similar topics

11
by: David Morgenthaler | last post by:
How does one overide the iterator implied by the construct "for line in file:"? For example, suppose I have a file containing row,col pairs on each line, and I wish to write a subclass of file...
1
by: Luis Ferrao | last post by:
Hi, My Windows Forms application uses the WebBrowser control to open an Excel file since OLE objects are gone in .Net. The application is actualy a clone of the one found in the MS Knowledge...
0
by: Steve Chatham | last post by:
I am stuck on this. It ought to be a simple reason as to why this is problematic, in that it works on smaller groups of data (say under 40 records), but doesn't on larger groups of records (40+)....
0
by: maitrepoy | last post by:
Hello I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office....
0
by: Microsoft | last post by:
I have a porgram that opens an excel workbook and modifies some data, but almost randomly a box will pop up in the workbook telling me the file is now available and to hit ok or cancel. This...
1
by: Job Lot | last post by:
i am querying excel file as follows Dim conn As New OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & _ "data source='" & "C:\Temp\SSPortfolio.xls" & " '; " & _ "Extended Properties=Excel...
2
by: buzzy | last post by:
Hi!! I have a question here where I used : Open sourceDir & sourceFile For Input As af Do While Not EOF(af) Line Input #af, textline If Trim(textline) Like "fruits" Then ...
5
by: cssExp | last post by:
alright suppose i have the following. <input type="file" name="upload" /> <input type="text" name="discription" /> <input type="image" onclick="addFile();" src="images/addfile.jpg" name="add"...
3
by: anudu | last post by:
hi, I am developing a system with asp.net, c#, and ajax. I have an excel file in server in "Server.MapPath("ExcelFiles/Test.xls")". I want to make it available to save to the disk in client...
2
by: ishakarthika | last post by:
i have a .txt file which contains line of string like the below format |111|34 sdddd| ppppp| A/C| 32| sadfd| |4324|23 mmm| yyyyy| A/C|32| fdfffdfd| the sixth column is the no...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.