Gluing to a Grouped Shape Using VBA

Hi,

You've all been so helpful! Another question. 

I create a line using

Set shLine = .DrawLine(1, 1, 2, 2)
Set clGlueStart = shLine.Cells("BeginX")


I have a grouped shape that contains a circle with different pie-shaped 
segments and I'd like to glue one end of the line to that shape. I try it 
using

Set cel1 = .Shapes("MyPie 1").Cells("PinX")
clGlueStart.GlueTo (cel1)

but I get a "Compile error: type mismatch" message.

Both clGlueStart and cel1 are dimensioned as cells, so that's not the 
problem. And when I check to see if the two named cells have numerical 
values, they do. What am I doing wrong?

Mike
0
MikeM (74)
9/24/2006 5:31:02 PM
visio 3638 articles. 1 followers. Follow

2 Replies
904 Views

Similar Articles

[PageSpeed] 39

Hi Mike,

One thing: VBA might be doing that "weird VBA parentheses thing", so these 
might work better:

    Call clGlueStart.GlueTo (cel1)

        or

    clGlueStart.GlueTo cel1

The other thing, your line is not a dynamic connector, and can't do the 
"glue to PinX thing". You'll have top put a connection point on the pie 
wedge and set cel1 to Shapes("MyPie 1").Cells("Connections.X1") or something 
similar.

-- 
Hope this helps,

Chris Roth
Visio MVP

More Visio shapes, articles, development info and pure diagramming fun at:
www.wanderkind.com/visio


"MikeM" <MikeM@discussions.microsoft.com> wrote in message 
news:52BC672B-2D9C-4FAC-A7A7-C70C217275A5@microsoft.com...
> Hi,
>
> You've all been so helpful! Another question.
>
> I create a line using
>
> Set shLine = .DrawLine(1, 1, 2, 2)
> Set clGlueStart = shLine.Cells("BeginX")
>
>
> I have a grouped shape that contains a circle with different pie-shaped
> segments and I'd like to glue one end of the line to that shape. I try it
> using
>
> Set cel1 = .Shapes("MyPie 1").Cells("PinX")
> clGlueStart.GlueTo (cel1)
>
> but I get a "Compile error: type mismatch" message.
>
> Both clGlueStart and cel1 are dimensioned as cells, so that's not the
> problem. And when I check to see if the two named cells have numerical
> values, they do. What am I doing wrong?
>
> Mike 


0
Chris
9/25/2006 7:17:34 AM
Chris:

Right on target!!

Thanks,
Mike

"Chris Roth [MVP]" wrote:

> Hi Mike,
> 
> One thing: VBA might be doing that "weird VBA parentheses thing", so these 
> might work better:
> 
>     Call clGlueStart.GlueTo (cel1)
> 
>         or
> 
>     clGlueStart.GlueTo cel1
> 
> The other thing, your line is not a dynamic connector, and can't do the 
> "glue to PinX thing". You'll have top put a connection point on the pie 
> wedge and set cel1 to Shapes("MyPie 1").Cells("Connections.X1") or something 
> similar.
> 
> -- 
> Hope this helps,
> 
> Chris Roth
> Visio MVP
> 
> More Visio shapes, articles, development info and pure diagramming fun at:
> www.wanderkind.com/visio
> 
> 
> "MikeM" <MikeM@discussions.microsoft.com> wrote in message 
> news:52BC672B-2D9C-4FAC-A7A7-C70C217275A5@microsoft.com...
> > Hi,
> >
> > You've all been so helpful! Another question.
> >
> > I create a line using
> >
> > Set shLine = .DrawLine(1, 1, 2, 2)
> > Set clGlueStart = shLine.Cells("BeginX")
> >
> >
> > I have a grouped shape that contains a circle with different pie-shaped
> > segments and I'd like to glue one end of the line to that shape. I try it
> > using
> >
> > Set cel1 = .Shapes("MyPie 1").Cells("PinX")
> > clGlueStart.GlueTo (cel1)
> >
> > but I get a "Compile error: type mismatch" message.
> >
> > Both clGlueStart and cel1 are dimensioned as cells, so that's not the
> > problem. And when I check to see if the two named cells have numerical
> > values, they do. What am I doing wrong?
> >
> > Mike 
> 
> 
> 
0
MikeM (74)
9/25/2006 12:26:02 PM
Reply:

Similar Artilces:

VBA: Copy a date and paste as text
Cell A1 contains a date formatted as follows: 11/4/2009 I want to write a VBA procedure that will read the date in A1 and insert it as text in B1 in the format 2009-11-04. I can accomplish this easily in excel by inputting the following function into B1: =TEXT(A1,"yyyy-mm-dd"). I would then copy the result and Paste Special > Values to get the intended result of text that reads 2009-11-04. I tried to replicate this in VBA using the following statement: Range("B1").Value = worksheetfunction.Text(Range("A1"), "yyyy-mm-dd") However, the ...

swap shape event when glued
i would like to setup a shape to change into another shape when glued. is this possible? On Wed, 19 Mar 2008 14:29:02 -0700, 53buick <53buick@discussions.microsoft.com> wrote: >i would like to setup a shape to change into another shape when glued. is >this possible? You could combine two shapes in two separate geometry sections, the visibility of each depending upon the glue status. -- Regards, Paul Herber, Sandrila Ltd. Visio Utilities http://www.visio-utilities.sandrila.co.uk/ ...

I wonder what the feeling are about using CCleaner.
I wonder what the feeling are about using CCleaner. I analyzed files using it and it suggested removing 4G worth of files. The Registry analysis shows pages of entries that can be removed. Some I reconize as being related to uninstalled software. Has anyone had bad experiences? Thanks On 15/12/2009 7:53 a.m., Cal Who wrote: > I wonder what the feeling are about using CCleaner. > > I analyzed files using it and it suggested removing 4G worth of files. > > The Registry analysis shows pages of entries that can be removed. Some I > reconize as being ...

Hiding a trendline using a button
Hi I want to hide/unhide a trendline using a button (or maybe 2 buttons, one for ON and one for OFF?). What would the code look like? This is purely a display function, I don't want to remove ('clear') the trendline. Thanks Phil Phil - You can't really hide the trendline. The option to use no line type is disabled. And you're stuck with the legend entry. Why not create and delete the trendline as needed? Attach these two macros to buttons: Sub TrendlineOn() ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1).Trendlines _ .Add Type:=xlLinear, Forward:=0,...

catalog merge group by field
I'm trying to do a catalog merge with multiple records grouped by a field. i.e. result would be Rubber Wedge WED15 $35 WED18 $38 PVC Wedge WEDP15 $22 WEDP18 $23 WEDP21 $24 Where the two recorde for rubber wedge are grouped by description field and the three records for PVC wedge are grouped by field. I cannot find instructions to do this in publisher help and there is no apparent button in the catalog merge area. Kevin wrote: > I cannot find instructions to do this in publisher help and there is no > apparent button in the catalog merge area. That would be because there is...

Group Count in Parent Group Header
Hello Experts, I know this has been asked several times on this forum. I have two groupings in my the report. i want the Header of the first grouping to show the count of records in the second groupings. I'm familiar with the trick where you create a text box, set it to 1, set running sum to over group etc. This works except i want to show the totals in the Header of the Group not the Footer. Thanks Hadi A couple of possible solutions. 1. Create a query that groups by the same field used in the first group and Counts the # of elements in the second group for each ...

Using SBS Server 2003 as a secondary Role
We have a small business server that has acted as our primary server (domain controller). We have recently added a server 2008 std system which we have within the last week moved all primary roles over to this new server. It was shortly after this the old sbs 2003 started shutting itself off. Further examination found that the system was shutting down due to licensing on the sbs need to have all the FSMO roles. We had origionally thought after we had everything tested we would demote the sbs 2003 system off and use it as a print server. Does SBS 2003 allow iteself to a...

Query-based distribution group not appearing in Address Book.
I have setup two query based distribution groups. These groups, as well as all other groups are in there own Organizational Unit called Head Office Groups. When you use the address book, the two query based groups do not appear. I have double checked that the 'Hide from Exchange Address Books' box isn't checked, even checking and unchecking, but they still will not appear. When you try and email either of the groups, you get the 'Microsoft Outlook does not recognize <Group Name>' When you click the 'Preview' button, it does display all the correc...

Outlook group by sender errors
We have outlook 2000 and the view configured to group messages by sender. One particular sender has had all it's emails deleted but is still showing with an email from another sender. The item count is incorrect. Any one got any ideas on this one? Thanks Paul ...

Category Group
How can we add new category group or modify pre-defined category groups? In microsoft.public.money, Mark wrote: >How can we add new category group or modify pre-defined >category groups? See FAQ available at http://www.bollar.org/msmoney/ for information. Plus it was not desirable to post twice. "Mark" <anonymous@discussions.microsoft.com> wrote in message news:74a201c3e76e$8c5a8ff0$a001280a@phx.gbl... > How can we add new category group or modify pre-defined > category groups? I asked a question about Category Groups not too long ago. Here was Dick Watson...

Running Great Plains from one server without using Terminal Services
Is it possible to setup great plains on an "Application Server" by not using Terminal Services. The users will also not have a local copy of Great Plains on their client machines. My idea is to create a hidden shared folder of the Great Plains directory. Then the users will have a shortcut on their desktop pointing to the GP instance on the server (using UNC naming). The client machines will have an ODBC setup to point to the database server. Has anyone done this kind of installation of Great Plains? Is it even advisable? This is possible in a LAN environment, but is defi...

Groups Gone Wild
It seems that Microsoft has accidentally created a few groups over the years, then removed them from their own servers. I'm afraid it's a hit/miss story, though, as far as them still being available on the broader usenet. Two I'm aware of: microsoft.public.access microsoft.public.word.programming On some NNTP servers, not on others. I don't know by what criteria NNTP admins accept rmgroup commands, but my impression was most don't these days because they're so easily forged. Question is, how long the old microsoft.public.vb.* hierarchy will su...

group e-mail
How do I create a nick name for a group and create a list of e-mail addresses to go with that nick name? I have tried to copy a list on in-coming e-mail, but it won't let me paste into my address book. "=?Utf-8?B?bWFjIHRvIGRlbGw=?=" <mac to dell@discussions.microsoft.com> wrote in news:AA2782ED-7291-420D-AEA2-4EEC64E4BCC5@microsoft.com: > How do I create a nick name for a group and create a list of e-mail > addresses to go with that nick name? I have tried to copy a list on > in-coming e-mail, but it won't let me paste into my address book. > What ver...

using HTM template in Outlook
Thank you for taking the time to review this. I am attempting to creat a template in Microsoft Publisher to use in Microsoft Outlook. I have save this template as HTM OR HTML format and have put it in my stationary folder. When I open a NEW email to send all seems to work. The new stationary is there. However, when I attempt to type on this stationary the whole image moves. Every time I hit a <return> enter it moves down. I would like for this template to remain fixed and unchangable if possible. I also would like for Outlook to default to the proper point at which to beg...

Correct use of StringCbPrintfW
Hello World, I am trying to convert a CString into a wide-character string and am trying to use the function StringCbPrintfW to do this. When I use the following code, on run-time I get a debug assertion message from vswprint.c that "string != NULL" and have no idea what I'm doing wrong, or if I should be using a different function altogether. LPWSTR lpctstrSourceFile; LPWSTR lpctstrFileName; CString strSource; .... strSource = System::IO::Path::GetFullPath(lpctstrSourceFile); HRESULT result=StringCbPrintfW(lpctstrFileName,strSource.GetLength()* sizeof(TCHAR),L"%s&quo...

Group Mailbox #2
I have a requirement as follows: group mailbox with smtp group@abc.com All users to be able to send on behalf of (the sent email must be in the sent folder of the group mailbox and not the users). Automated individual signature to recognize who sent email. Users must not be able to delete any emails from the group mailbox. All users have a personal mailbox which must not be confused with the group one. The solution implemented almost works: The users have full permission on the group mailbox. Outlook client opens the group mailbox and users use OWA to access personal. Signature setu...

can I use Publisher to set up signatures of 8 pages?
I neeed to print and bind a book. I can't find any way to set up and print in sgnatures of 8 or so pages. I seem to be limited to 4 page bookfold. Any ideas? Insert, page -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "traveller" <traveller@discussions.microsoft.com> wrote in message news:9FD3B5CB-8D56-49DE-B632-06617A54EBE7@microsoft.com... >I neeed to print and bind a book. I can't find any way to set up and print in > sgnatures of 8 or so pages. I seem to be limited to 4 page bookfold. Any > idea...

Choose what email to use when sending email!!!
I've got SBS2003 set up and working. Pop3 connector is donwloading my email from my 2 email domain without any problems (@domain1.com and @domain2.com). Now what can I do to choose what email to use when sending email??? Please help me Cyril ...

how to use excel to creat an oncall schedule #2
i wantb to creat oncall schedule for doctors in a hospital. each 2 doctors would be on call for 12 hours a day. it can look like calendar and it should calculae how many days each one was oncall up to date. Let's say we have twelve worksheets in a workbook, one for each month. In each worksheet there would be one column for each doctor, doctor's name in the top row. Rows 2 thru 32 could correspond to the days of the month. Enter a 1 if the doctor was on-call that day. At the bottom of each worksheet in row 35 enter formula like: =SUM(A2:A32) and copy across. -- Gary''...

Gluing to a Grouped Shape Using VBA
Hi, You've all been so helpful! Another question. I create a line using Set shLine = .DrawLine(1, 1, 2, 2) Set clGlueStart = shLine.Cells("BeginX") I have a grouped shape that contains a circle with different pie-shaped segments and I'd like to glue one end of the line to that shape. I try it using Set cel1 = .Shapes("MyPie 1").Cells("PinX") clGlueStart.GlueTo (cel1) but I get a "Compile error: type mismatch" message. Both clGlueStart and cel1 are dimensioned as cells, so that's not the problem. And when I check to see if the two ...

When is 4th conditional format field (text) used?
I have been trying to figure out how the 4 conditional format field work. I can get the first 3 (positive, negative, zero) to work, but I can't get the 4th to work. When is it invoked? I assigned the following custom formatting string, "Pos";"Neg";"Zero";"Text" to a cell and put various values inside. Nothing I put in the cell gets "Text" to be displayed. What am I doing wrong? It works for me each time I enter a non-numeric (text) value into the cell. Did you really want to see the characters Text in that cell? (I'd try it...

output a series of field records to a text string using a loop?
previously, I was able to do this by having seperate field names; for example: stAppName = "C:\Program Files\Internet Explorer\iexplore.exe http://maps.google.co.uk/maps?f=q&hl=en&q= " & "from: " & Link_Waypoint_1 + ", London" & (" to: " + Link_Waypoint_2 + ", London") & (" to: " + Link_Waypoint_3 + ", London") & (" to: " + Link_Waypoint_4 + ", London") & (" to: " + Link_Waypoint_5 + ", London") But now, instead of a 'spreadsheet style table&...

Routing group
I have 2 exchange 2003 servers in 2 different locations. Exchange-A and Exchange-B Exchange-A in Site A that has internet connection Exchange-B in Site B that has internet connection as well. Both Site A and Site B are connected via VPN permenantely. In addition, both networks are in same forest/domain, but different subnet. Both exchange servers are in same organization as well. I'd like to have both of these exchange connected together, however I want users in Exchange-B send/recieve their external emails to/from smtp virtual server in Exchange-A in Site-A. Do I need to create a new ...

Query-based distribution group feature
I am just wondering whether the query-based distribution group is compatible with all client mail (both exchange and outlook express) or not. I am gonna use this feature, but not sure about any effects that may occur with the existing system. Please advise me which points I should be aware. Thank you in advance. QBDGs are expanded by the Categorizer on the Exchange server. It should not matter what client sent the properly formatted message to QBDG SMTP address. Effects on the server might include performance issues. There is a good KB article summarizing issues with QBDG: How t...

group check box records
I have a report based on a query. How can I group records by the last time (max date) a check box is true? -- Thanks for your help! Walter Sorting and grouping in a report is always accomplished by using the Sorting and Grouping dialog in the report design view. -- Duane Hookom Microsoft Access MVP "Walter" wrote: > I have a report based on a query. How can I group records by the last time > (max date) a check box is true? > -- > Thanks for your help! > Walter I haven't been able to figure out how to accomplish what I want or if it&#...