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

Excel automation from .net

I am automating an Excel Spreadsheet from a .net windows
app. I have no problem automating various Excel cells
based upon the following declarations. My question is how
do I open an Excel Form from a .vba.net form, and how do
you " fire" an event on the Excel form (for example "
button click.")
This is how I communicate to Excel targeted cells
from .net

Public objApp As Excel.Application
Public objBook As Excel._Workbook
Public objBooks As Excel.Workbooks
Public objsheets As Excel.Sheets
Public objSheet As Excel._Worksheet
Public objChart As Excel.Chart

'declare the target cells for each procedure.

objsheets = objBook.Worksheets
objSheet = objsheets("Sheet1")

objsheet.Range("a1").Select
Assuming I have a button click event on Excel Form 1 and
Form 2, how would I fire those events from .net

Following up, how do you show/hide the excel same forms,
and close them?

Thanx
Jul 21 '05 #1
1 3108
Workbooks.Open Filename:= _
"SomePath\TransmissionLogs.xls"
"Erling" <oc**********@snet.net> wrote in message
news:59****************************@phx.gbl...
I am automating an Excel Spreadsheet from a .net windows
app. I have no problem automating various Excel cells
based upon the following declarations. My question is how
do I open an Excel Form from a .vba.net form, and how do
you " fire" an event on the Excel form (for example "
button click.")
This is how I communicate to Excel targeted cells
from .net

Public objApp As Excel.Application
Public objBook As Excel._Workbook
Public objBooks As Excel.Workbooks
Public objsheets As Excel.Sheets
Public objSheet As Excel._Worksheet
Public objChart As Excel.Chart

'declare the target cells for each procedure.

objsheets = objBook.Worksheets
objSheet = objsheets("Sheet1")

objsheet.Range("a1").Select
Assuming I have a button click event on Excel Form 1 and
Form 2, how would I fire those events from .net

Following up, how do you show/hide the excel same forms,
and close them?

Thanx

Jul 21 '05 #2

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

Similar topics

17
by: Ange T | last post by:
Hi there, I'm having pain with the VB behind an Access form. The form is used to create reports in Excel based on the details entered in the form. This has always worked without error on my...
2
by: jeffgeorge | last post by:
I'm currently exporting a form to Excel. Because there are controls and totals in the header, I first have a button for users to convert to a datasheet. Then I use the automated quick office...
7
by: taylor.bryant | last post by:
I am running: Win XP SP2 Excel 2002, Access 2002 (Office XP SP3) Using Visual Basic (not VB.NET) At one point (prior to XP SP2?!? - I can't pin it down), this did not happen and I was easily...
1
by: cybertof | last post by:
Hello, Is there a way to connect (through automation) a c# application to a running Excel 2003 instance on a specific workbook ? In the past, i used to use GetObject(...) function in VB6. ...
17
by: Mansi | last post by:
I need to do some research on how to use excel automation from c#. Does anyone know of any good books related to this subject? Thanks. Mansi
12
by: D. Shane Fowlkes | last post by:
This most likely belongs in another forum but I thought I'd start here. I have a COM Object written in VB6. The DLL will access MS Excel and use it's Object Library to write a customized report...
3
by: Carlos Magalhaes | last post by:
Hey All, I am doing some excel automation using the excel COM. I can do most of the functions and its working well until I come across a formula. I can run a formula and insert the formula...
3
by: Mitchell Vincent | last post by:
Does anyone have some good examples of Excel automation with (VB).NET? I have some Excel spreadsheets that a customer needs parsed out but I've never tried to use Excel programatically before! ...
6
by: a.theil | last post by:
Please help! I need a simple excel automation, just 2 write some files into excel. I do: Dim oXL As Excel.Application Dim oWB As Excel.Workbook Dim oSheet As Excel.Worksheet Dim oRng As...
1
by: Troy | last post by:
I have VB.Net code that opens Excel files and imports data from them. It works fine for all versions up to 2003 and has for over a year. We have users updating to Office 2003 and the Excel...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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,...

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.