473,804 Members | 3,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening an XLS file

Hi,
I am using Excel as a com object in VB.Net - anyone know how I can open an
xls file please.

Research seems to give me Axspreadsheet1. Workbooks.Open( ) but that doesn't
exist.

I can use the activesheet and copy/paste enter values in cells etc, but how
do I open a file and load the spreadsheet

thanks

Pete
Mar 21 '07 #1
3 4781
On Mar 21, 8:54 am, "Pete Vickers" <pete.vick...@t hesleepdepot.co m>
wrote:
Hi,
I am using Excel as a com object in VB.Net - anyone know how I can open an
xls file please.

Research seems to give me Axspreadsheet1. Workbooks.Open( ) but that doesn't
exist.

I can use the activesheet and copy/paste enter values in cells etc, but how
do I open a file and load the spreadsheet

thanks

Pete
Not sure if it is applicable in your case, but I use the Microsoft
Excel ODBC Driver to open and read worksheets with SQLlike SELECT
statements.

Mar 21 '07 #2
Are you trying to read the data out of a spreadsheet, or are you trying to
manipulate the data *in* the spreadsheet?

Robin S.
-------------------------
"Pete Vickers" <pe**********@t hesleepdepot.co mwrote in message
news:ON******** *****@TK2MSFTNG P05.phx.gbl...
Hi,
I am using Excel as a com object in VB.Net - anyone know how I can open
an xls file please.

Research seems to give me Axspreadsheet1. Workbooks.Open( ) but that
doesn't exist.

I can use the activesheet and copy/paste enter values in cells etc, but
how do I open a file and load the spreadsheet

thanks

Pete


Mar 22 '07 #3
On Wed, 21 Mar 2007 12:54:40 -0000, "Pete Vickers" <pe**********@t hesleepdepot.co mwrote:

¤ Hi,
¤ I am using Excel as a com object in VB.Net - anyone know how I can open an
¤ xls file please.
¤
¤ Research seems to give me Axspreadsheet1. Workbooks.Open( ) but that doesn't
¤ exist.
¤
¤ I can use the activesheet and copy/paste enter values in cells etc, but how
¤ do I open a file and load the spreadsheet

See if the following gets you started:

How to automate Microsoft Excel from Visual Basic .NET
http://support.microsoft.com/kb/301982

How To Automate Excel from Visual Basic .NET to Fill or to Obtain Data in a Range by Using Arrays
http://support.microsoft.com/kb/302094
Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 22 '07 #4

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

Similar topics

5
714
by: PM | last post by:
Has anyone found a way to open a file exclusively where it will fail if the file is already open, i have tried the following _FileStream = new FileStream(@"C:\Data.txt", FileMode.Open, FileAccess.ReadWrite, FileShare.None); which does not prevent me from opening the file even if another user has the file open ie Notepad, it will prevent me from saving the file in notepad until i close the file in the app. I can then save changes made in...
1
4405
by: Alfons | last post by:
Hello, I have build a program that can do file transferring between a Windows XP computer and a DOS computer via a serial port. The Windows program I have build in C++ with Visual Studio 6.0. The DOS program I made in Turbo C++ 3.0. At this moment I am in a test phase of sending files and directories. The code I am using in DOS to open a file for writing looks like this (forgive me the typos, since I only have my source code at work...
14
11100
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
5
3345
by: Brad | last post by:
In several aspx applications I export crytal reports to pdf, xls and doc files and then the aspx page writes the selected export file to the client browser. This all works with one small quirk: When I run any of the web apps on my workstations iis website, the pdf download always produces the "File Download" dialog, even though I have Confirm after Download turned off. When I select to Open the file from this dialog the file opens in...
11
3620
by: aldrin | last post by:
I'm trying to run this code under windows xp sp2 using codeblocks v1.0 compiler with great difficulty.There is no problem with running this under KDevelop in linux. Any help would be greatly appreciated. Enter an interesting string. Too many cooks spoil the broth Error opening C:\myfile.txt for writing. Program termnated. This application has requested the Runtime to terminate it in an unusual way.
2
5029
by: Craig | last post by:
Hi there, I'm trying to open colour BMPs using PIL and I'm getting the following errors. Opening a 16 colour BMP I get: Traceback (most recent call last): File "<pyshell#3>", line 1, in <module>
9
2320
compman9902
by: compman9902 | last post by:
Hello, and thank toy for reading this post. Thus far, this website has helped me a lot, (I have finally finished my encryptor: "site removed by moderator", go to the downloads link) and I will continue asking for help (so my rank may finally increase). Right now the topic at hand for me is opening file dialogs. Right now, the issue at hand is opening up a fully functional G.U.I. file prompt (both for opening and saving files please) that has...
15
2238
by: Umesh | last post by:
how to open a website like yahoo.com and use it as input? The following code doesn't work. #include"stdio.h" int main() { FILE *f; f=fopen("http://www.yahoo.com","r"); if(f==NULL)
1
1832
by: Sanjeeva K kanakam | last post by:
Hi all, I am developing one application. In that i have created on report file which contains tables, titles and tree view list also by using HTML tags. I am opening this file in my application it self as another window. There is no problem in opening this file if the file is small. If the file is big(here i mean to say if number of tables present in this file)then while opening this file my application is displaying a message "Cannot create...
34
5375
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> os.startfile("C:\Documents and Settings\Alex\My Documents\My
0
9705
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
9576
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,...
0
10323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
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
10074
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
9138
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...
0
6847
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();...
1
4291
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 we have to send another system
3
2983
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.