<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Converting VBA to VB.NET' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Converting VBA to VB.NET' posted on the 'VB.NET' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Thu, 09 Feb 2012 07:28:59 -0800</pubDate>
    <lastBuildDate>Thu, 09 Feb 2012 07:28:59 -0800</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Converting VBA to VB.NET</title>
      <link>http://www.programmersheaven.com/mb/VBNET/408892/408892/converting-vba-to-vbnet/</link>
      <description>Hello All,&lt;br /&gt;
&lt;br /&gt;
I am a newbie to Visual Studio and am looking to convert my VBA scripts to an Add-In.  The first thing I need to do is create the custom toolbar.&lt;br /&gt;
&lt;br /&gt;
In VBA:&lt;br /&gt;
Set MyBar = CommandBars("My Macros")&lt;br /&gt;
Debug.Print MyBar&lt;br /&gt;
If MyBar Is Nothing Then&lt;br /&gt;
    Set MyBar = CommandBars.Add(Name:="My Macros", Position:=msoBarTop, &lt;br /&gt;
temporary:=False)&lt;br /&gt;
    MyBar.Protection = msoBarNoCustomize&lt;br /&gt;
    MyBar.Visible = True&lt;br /&gt;
End If&lt;br /&gt;
&lt;br /&gt;
In Visual Studio using VB this is where my porting comes unstuck and where I need to be pointed in the right direction.&lt;br /&gt;
&lt;br /&gt;
MyBar = CommandBars("My Macros")&lt;br /&gt;
If MyBar Is Nothing Then&lt;br /&gt;
  CommandBars.Add(Name:="My Macros", Position:=MsoBarPosition.msoBarTop, Temporary:=False)&lt;br /&gt;
  MyBar.Protection = MsoBarProtection.msoBarNoCustomize&lt;br /&gt;
  MyBar.Visible = True&lt;br /&gt;
End If&lt;br /&gt;
&lt;br /&gt;
The problem is with the use of "CommandBars".  I have imported &lt;br /&gt;
Microsoft.VisualStudio.CommandBars.  The context message I receive is:&lt;br /&gt;
'Reference to a non-shared member requires an object reference.'  Everything else is good.&lt;br /&gt;
&lt;br /&gt;
This has been buggin me for a couple of days.  I've tried using &lt;br /&gt;
_CommandBars.CommandBars - nup; Application.CommandBars - nup; among other &lt;br /&gt;
attempts.&lt;br /&gt;
&lt;br /&gt;
Any ideas, please?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Michael A.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/408892/408892/converting-vba-to-vbnet/</guid>
      <pubDate>Thu, 05 Nov 2009 15:14:40 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Converting VBA to VB.NET</title>
      <link>http://www.programmersheaven.com/mb/VBNET/408892/409097/re-converting-vba-to-vbnet/#409097</link>
      <description>I do not know anything about command bars... I couldn't find the namespace Microsoft.VisualStudio.CommandBars. I couldn't find anything on google in the few searches I tryed&lt;br /&gt;
&lt;br /&gt;
If you can provide any examples of good CommandBar code in Vb.Net then I can assist you. Otherwise, you could try finding a new method to do what you want to do.&lt;br /&gt;
&lt;br /&gt;
What was the function of the command bar in your old VBA program?&lt;br /&gt;
&lt;br /&gt;
Sean Campbell</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/408892/409097/re-converting-vba-to-vbnet/#409097</guid>
      <pubDate>Wed, 11 Nov 2009 07:55:07 -0800</pubDate>
      <category>VB.NET</category>
    </item>
  </channel>
</rss>
