473,404 Members | 2,114 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,404 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 1186

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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
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,...

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.