Excel automation border

gedas
Member Posts: 87
Hi,
What i do wrong??
Why string: autSheet.Range('A7').Borders.LineStyle:='xlContinuous'; get automation error, when other strings: autSheet.Range('A7').Font.Bold:=TRUE; are OK???
RGDS
What i do wrong??
Why string: autSheet.Range('A7').Borders.LineStyle:='xlContinuous'; get automation error, when other strings: autSheet.Range('A7').Font.Bold:=TRUE; are OK???
RGDS
GB
0
Comments
-
I use following code to get a border in Excel:
function Border(Cell_No : Text[7]; Thickness : Integer)
xlSheet.Range(Cell_No).BorderAround(10,Thickness);No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Thanx Luc,
Its work.
But i've never thougt some automations must be in function, and not working directly.GB0 -
You don't need to use a function per se. But you are overlooking that Excel often uses named constants instead of values. Named constants are in most cases recognized by the first few letters of the name - 'xl' = Excel, 'wd' = Word, 'pj' = MS Project, 'cdl' = Common Dialog and so on.
To find the value of such a constant, go to the VBA editor in Excel, call up the References box (F2) and type the name of the constant in the search field. When found, the value is shown at the bottom of the window.
John0 -
Navision: 5 SP1 (Native, not SQL)
I am using this Excel.dll as automation: 'Microsoft Excel 11.0 Object Library'
Problem: Setting Left/Right/Top/Bottom border.
Setting a BorderArround was not much of a Challenge..
But right now i'm going nuts trying to set a specific type of border..
* BORDER / ENUMERATION
- Left Border / 7
- Right Border / 10
- Top Border / 8
- Bottom Border / 9
- Diagonal Up Border / 6
- Diagonal Down Border / 5
I have added the Excel.dll as a reference to VB.NET to see what paremeters the "Borders" function provides.
And as it seems you should be able to do this:
* autExcel.Borders(ENUMERATION).LineStyle := 1 ;
Also, according to VB.NET, the ENUMERATION is a "hiddenmemberparam".
And so, Navision keeps telling me that "maximum of 0 parameters was exceeded".
Navision does not accept the "Borders(ENUM)...", it only accepts "Borders..." (no parameters)
So my question is, how in gods name do i, for example, set a Left Border.
Is it even possible in Navision with this dll?
Any and All help is welcome!0 -
Hmm,..
Besides navision beïng retarted and not allowing you to use a dll's full functionality, there is a way to set for example a Left Border ..
Default Border Arround:
autRange.BorderAround
Specific Type of Border:
autRange.Borders.Item(lintBorderIndex);
And here are the Enumerations:
CASE (loptBorder) OF
loptBorder::"Edge Left" : lintBorderIndex := 7;
loptBorder::"Edge Right" : lintBorderIndex := 10;
loptBorder::"Edge Top" : lintBorderIndex := 8;
loptBorder::"Edge Bottom" : lintBorderIndex := 9;
loptBorder::"Inside Horizontal" : lintBorderIndex := 12;
loptBorder::"Inside Vertical" : lintBorderIndex := 11;
loptBorder::"Diagonal Up" : lintBorderIndex := 6;
loptBorder::"Diagonal Down" : lintBorderIndex := 5;
END;0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions