LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Errors With Late Binding

You don't

strFields = "A2:A" & intRecords + 1
ExcelApp.Sheets(strSource).Range(strFields).Copy


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dustin Ventin" wrote in message
...
In that case, how would I select and copy a certain range of records, such
as I am doing with the following code:

ExcelApp.Sheets(strSource).Select
strFields = "A2:A" & intRecords + 1
ExcelApp.Range(strFields).Select
ExcelApp.CutCopyMode = False
ExcelApp.Selection.Copy

Thanks!

Dustin

"Bob Phillips" wrote:

Don't need to use select, shouldn't use select.

And the reason is that it is slow and makes the coding much more

convoluted
and difficult to maintain.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dustin Ventin" wrote in

message
...
Don't need to what? Why shouldn't I use select?

Thanks.

Dustin

"Bob Phillips" wrote:

You don't need to, shouldn't use Select, and you need to specify the

sheet

With ExcelApp.Worksheets("Sheet1")
.Range("H2:AD2").AutoFill _
Destination:= ExcelApp.Range("H2:AD" & intRecords), _
Type:=xlFillDefault
End With
..

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dustin Ventin" wrote in

message
...
I am writing a Microsoft Access application that exports data to

Excel,
and
have just started using late binding. However, I am experiecing

some
errors
now that I have done so.

'Here is where I input the late binding code
Dim ExcelApp As Object
Set ExcelApp = CreateObject("Excel.Application")

'Here is where I try to copy the cell formulas to encompass

all
input
rows

ExcelApp.Range("H2:AD2").Select
strFields = "H2:AD" & intRecords
ExcelApp.Selection.AutoFill

Destination:=ExcelApp.Range(strFields),
Type:=xlFillDefault

strFields is set to encompass all the rows that have been imported

into
Excel. However, the application no longer seems to work at the

last
line
of
code.

ExcelApp.Selection.AutoFill

Destination:=ExcelApp.Range(strFields),
Type:=xlFillDefault

Any ideas?

Thanks!

Dustin










 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
Late Binding help, Please Bud Dean Excel Programming 5 September 24th 04 04:31 AM
Late Binding Todd Huttenstine[_3_] Excel Programming 3 April 30th 04 11:01 AM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM
DAO Late Binding? Sharqua Excel Programming 2 January 4th 04 02:05 AM


All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"