Plot points from an import of xy absolute coordinates in a excel file

Started by bendesarts, October 07, 2016, 02:44:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bendesarts

Surrogate,
If I understand, I should create this code in visual basic but in visio. --> OK
But, after how the excel file containing the xy coordinates of the points is called ?
thank you for your help

Surrogate

Quote from: bendesarts on October 10, 2016, 08:38:33 AM
I should create this code in visual basic but in visio. --> OK
yes, you are rigth. my code for VBA IDE build-in Visio
Quote from: bendesarts on October 10, 2016, 08:38:33 AMBut, after how the excel file containing the xy coordinates of the points is called ?
my code use late binding ! there i define Excel Application and Excel's ActiveWorkbook
Dim ea As Object ' Excel Application
Dim ew As Object ' Excel Workbook
Set ea = GetObject(, "excel.Application")
Set ew = ea.activeworkbook
if workbook with xy-coordinates is activeworkbook, my code read these data from 1st sheet of that workbook, from first and second columns !
Quote from: Surrogate on October 09, 2016, 11:47:08 PM2. fill x values in 1st column.  fill y values in 2nd column
no magic, just code !

bendesarts

OK

1) May you help me to put the right code to specify correctly the full directory path to the file and the good sheet in the excel file ?

Here my proposal but the sheet of the excel file is not specified for the moment :

Dim ea As Object ' Excel Application
Dim ew As Object ' Excel Workbook
Set ea = GetObject(c:\[b]windows\test\ExcelFile[/b], "excel.Application")
Set ew = ea.activeworkbook


2) with this code, is the sheet selected the sheet1 by default ?

Thank you for you feedback

Surrogate

Quote from: bendesarts on October 10, 2016, 09:18:40 AMhelp me to put the right code to specify correctly the full directory path
You don't need put directory path to GetObject function, it is Optional argument !
Quote from: MSDNGetObject Function
Quote from: bendesarts on October 10, 2016, 09:18:40 AM2) with this code, is the sheet selected the sheet1 by default ?
Yes.
try this file

bendesarts


Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 227 (show)
Files included: 34 - 1321KB. (show)
Memory used: 1099KB.
Tokens: post-login.
Cache hits: 11: 0.00199s for 26,572 bytes (show)
Cache misses: 1: (show)
Queries used: 13.

[Show Queries]