Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Trying to convert from Early to Late binding

You have to convert constants like xlDiagonalDown into their numerical
equivalents. In Excel's Immediate Window, type a question mark and the
constant, and press enter to get the value:

?xlDiagonalDown
5

Also make sure that the variables are declared (Dim statements) as Object,
not as any of the Excel variable types. You are declaring the variables,
aren't you?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"David" wrote in message
...
Hello all,
I am using this code in Access 2003, VBA. This bit of code that works
well
with a reference to Excel 2003, unfortunately I need to try and convert
this
to Late binding so I can remove the reference to Excel 2003. I'm not very
familar with early binding/late binding. So please forgive me if I am
mis-speaking.

I am getting error 1004 - Application defined or object defined error on
line 820.

Can someone help me re-work this code to Late Binding?

790 Set objActiveWkb = objXLBook.Application.ActiveWorkbook


'*********** MAIN WITH statement

800 With objActiveWkb 'Main With Statement

810 .Application.Range("A1:W1").Select


820 .Application.Selection.Borders(xlDiagonalDown).Lin eStyle =
xlNone

830 .Application.Selection.Borders(xlDiagonalUp).LineS tyle =
xlNone

840 With .Application.Selection.Borders(xlEdgeLeft)
850 .LineStyle = xlContinuous
860 .Weight = xlThin
870 .ColorIndex = xlAutomatic
880 End With

890 With .Application.Selection.Borders(xlEdgeTop)
900 .LineStyle = xlContinuous
910 .Weight = xlThin
920 .ColorIndex = xlAutomatic
930 End With

The code continues with a series of with blocks to format the
xlEdgeBottom,
xlEdgeRight, xlInsideVertical.

Then a final End If statement.


Thank you for your assistance.



Reply
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
Early and Late Binding Vba Excel VJ Excel Programming 7 April 7th 05 06:05 PM
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
VBA References - when is Office Object Library Reference set? Best practice re. Early/Late binding ... AndyB Excel Programming 5 April 22nd 04 02:11 PM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM
Early vs Late Binding - Word John Wilson Excel Programming 6 November 13th 03 03:21 PM


All times are GMT +1. The time now is 05:31 AM.

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

About Us

"It's about Microsoft Excel"