473,503 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel automation problem

During Excel automation in VB one can lock lines for
scrolling by the following code

ActiveWindow.FreezePanes = True

what would be the equivalent in c#?

Is it some way to convert or generate Excel Macron in C#
rather than in VB?

Greateful for answers!
Kalle
Nov 15 '05 #1
2 2231
Kalle,

You would use the same property assignment in C#. However, VB makes
late-binding very easy (which I assume is what you are doing). In C#, it
would be easier if you placed a reference to the "Microsoft Excel Object
Library" in your project, and then cast the ActiveWindow instance (which is
off the Application object you will create) to the appropriate worksheet
instance.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Kalle" <ka************@neuro.ki.se> wrote in message
news:1b****************************@phx.gbl...
During Excel automation in VB one can lock lines for
scrolling by the following code

ActiveWindow.FreezePanes = True

what would be the equivalent in c#?

Is it some way to convert or generate Excel Macron in C#
rather than in VB?

Greateful for answers!
Kalle

Nov 15 '05 #2
Thank you for a quick answer!
I've got it working now.
Kalle
-----Original Message-----
Kalle,

You would use the same property assignment in C#. However, VB makeslate-binding very easy (which I assume is what you are doing). In C#, itwould be easier if you placed a reference to the "Microsoft Excel ObjectLibrary" in your project, and then cast the ActiveWindow instance (which isoff the Application object you will create) to the appropriate worksheetinstance.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot) paldino=at=exisconsulting<dot>com
"Kalle" <ka************@neuro.ki.se> wrote in message
news:1b****************************@phx.gbl...
During Excel automation in VB one can lock lines for
scrolling by the following code

ActiveWindow.FreezePanes = True

what would be the equivalent in c#?

Is it some way to convert or generate Excel Macron in C# rather than in VB?

Greateful for answers!
Kalle

.

Nov 15 '05 #3

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

Similar topics

17
27219
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...
6
14535
by: Frank X | last post by:
Excel 2002 introduced a capability to add custom worksheet functions to Excel direct from a COM/ActiveX object. I can use C# to develop a COM object which I can use fine from Excel/VBA, however...
17
6301
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
6
9334
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty...
8
2169
by: jack | last post by:
Access is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it...
12
2399
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...
1
7612
by: Robin Tucker | last post by:
Heres and interesting problem: I have a VB.NET program that creates reports via. Word Automation. This all works fine. What I want to do as part of this report generation process is to embed a...
6
598
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...
6
2056
by: Gunawan | last post by:
Dear All, I have create an excel (COM Object) using this code Excel.Application xls = new Excel.Application(); but I can not remove it from memory although I have using close and quit ...
15
5325
by: =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= | last post by:
Hi All, We are in the process of Upgrade Excel 2003 (Office 2003) to Excel 2007 (Office 2007) for one of web application. This web application is using Excel (Pivot Table) reports. With Excel...
0
7274
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,...
1
6984
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
7453
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...
0
5576
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,...
1
5005
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...
0
3162
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...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
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...

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.