Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,934 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,562 people online right now. Registration is fast and FREE... Join Now!




AutoFill excel function in VB 2005

 
Reply to this topicStart new topic

AutoFill excel function in VB 2005

scalt
12 Dec, 2007 - 02:55 PM
Post #1

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 114



Thanked: 3 times
Dream Kudos: 25
My Contributions
Hi,

Does anyone know how exactly to use the autofill function as part of the excel tools available with VB 2005?

I have tried this (based on excel macros - which I know don't port across directly - and some exaples on the web) but it gives me an HRESULT exception error every time it hits the code:
CODE

xlOutApp.Range(xlOutSht.Cells(2,2)).AutoFill(xlOutSht.Range(xlOutSht.Cells(2,2), xlOutSht.Cells(10,2)))


I'm pretty sure that I am probably doing something the wrong way, I just don't know what.

Thanks


EDIT: I found the problem. Changed to: xlOutSht.Range(xlOutSht.Cells(2,2), xlOutSht.Cells(2,2)).AutoFill(xlOutSht.Range(xlOutSht.Cells(2,2), xlOutSht.Cells(10,2)))


This post has been edited by scalt: 13 Dec, 2007 - 01:35 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 03:51PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month