Thread: MVB Syntax Error On Attribute VB_name - VBForums

  • Register
  • Help
  • Remember Me?
VBForums - Visual Basic and VB .NET Discussions and More!
  • Advanced Search
  • Home
  • VBForums
  • Visual Basic
  • Office Development
  • MVB syntax error on Attribute VB_name
Results 1 to 11 of 11 Thread: MVB syntax error on Attribute VB_name share-icon
  • Thread Tools
    • Show Printable Version
  • Display
    • Linear Mode
    • Switch to Hybrid Mode
    • Switch to Threaded Mode
  1. Jun 25th, 2009, 10:08 PM #1 nn55nn
    • View Profile
    • View Forum Posts
    nn55nn is offline

    Thread Starter New Member Join Date Jun 2009 Posts 3

    MVB syntax error on Attribute VB_name

    Hi I get a compile error on first line of the code that is in the text file attachment I opened Word 2007 alt-F11 to bring up MVB imported the bas file and selected tools->macros, then ran it "Compile Error: Syntax error" on the very first line, It said this was wrong Attribute VB_Name = "Word2TWiki" First few lines of Code is below===>> Attribute VB_Name = "Word2TWiki" 'Attribute VB_Name = "Word2Wiki" Dim FileName As String, FolderName As String, doctitle As String Dim htmlFile As String Sub Word2TWiki() 'This function can be used to convert a Word doc to the TWiki formatting language 'For references: http://www.twiki.org/cgi-bin/view/Pl...ToTWikiMLAddOn Dim runtime As Single 'new Dim tocfind As Boolean runtime = Timer Application.ScreenUpdating = False . . . FULL file is attached thanks Dennis
    Attached Files Attached Files
    • File Type: bas Word2TWiki.bas (19.5 KB, 296 views)
    Reply With Quote Reply With Quote
  2. Jun 26th, 2009, 09:44 AM #2 si_the_geek
    • View Profile
    • View Forum Posts
    si_the_geek is offline Super Moderator si_the_geek's Avatar Join Date Jul 2002 Location Bristol, UK Posts 41,937

    Re: MVB syntax error on Attribute VB_name

    Welcome to VBForums The problem is with how you "imported the bas file", as that line should be in the file - but not in the code (it is to tell VB what to use as the name of the file from within code, and in the window title etc). It seems that you copied & pasted the contents of the file, whereas what you should do is right-click on the Project window and select "Import file...". When I did that, the red line was not visible, but the part in quotes was used as the name.
    (Microsoft MVP from July 2007 to June 2017) . . . . . . . . . . Hitchhiker's Guide to Getting Help at VBForums Database Development FAQs/Tutorials (updated May 2011) (includes fixing common DB related errors, and [VB.Net] ADO.Net Tutorial, and [Classic VB] ADO tutorial /further steps) other useful DB bits: . Connection strings (alternative copy).•. MDAC/Jet/ACE downloads .•. SQL Server downloads . Classic VB FAQs (updated Oct 2010) (includes fixing common VB errors) some of my Classic VB bits: . Tutorial: How to automate Excel from VB6 (or VB5/VBA) .•. SQL 'Select' statement formatter/checker .•. Convert colour number to colour name .•. FlexGrid: fill from recordset .•. FlexGrid: AutoSize columns .•. DB Reserved Words checker .
    Reply With Quote Reply With Quote
  3. Jun 26th, 2009, 02:55 PM #3 nn55nn
    • View Profile
    • View Forum Posts
    nn55nn is offline

    Thread Starter New Member Join Date Jun 2009 Posts 3

    Re: MVB syntax error on Attribute VB_name

    Thanks for the help, yes, import got me past the problem on the first line of that bas file. However, I now get another syntax error : ConvertTables ActiveDocument.Save ' Copy to clipboard ActiveDocument.Content.Copy Dim MyDataObj As New DataObject, GetOffClipboard As Variant It flags what I highlighted and the pop-up says Compile error: User-defined type not defined. thanks Dennis
    Reply With Quote Reply With Quote
  4. Jun 26th, 2009, 10:21 PM #4 westconn1
    • View Profile
    • View Forum Posts
    westconn1 is offline PowerPoster Join Date Dec 2004 Posts 25,618

    Re: MVB syntax error on Attribute VB_name

    Dim MyDataObj As New DataObject, add a reference to msforms2 controls (object library)
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part come back and mark your original post as resolved if your problem is fixed pete
    Reply With Quote Reply With Quote
  5. Jun 27th, 2009, 06:20 PM #5 nn55nn
    • View Profile
    • View Forum Posts
    nn55nn is offline

    Thread Starter New Member Join Date Jun 2009 Posts 3

    Re: MVB syntax error on Attribute VB_name

    Hi Pete, Were you referring to my post as code snippets? If so, my original post has the complete script/code attached. code snippets posted came from that attached file. I dont have msforms2 as being available. Im trying to compile a macro for ms word, through alt-F11 in win word, which pops up mvb. Thanx Dennis
    Reply With Quote Reply With Quote
  6. Jun 27th, 2009, 09:08 PM #6 westconn1
    • View Profile
    • View Forum Posts
    westconn1 is offline PowerPoster Join Date Dec 2004 Posts 25,618

    Re: MVB syntax error on Attribute VB_name

    if you add a userform it automatically adds a reference to msforms2 object library otherwise you can go to menu > tools > references, find in the list and check the box
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part come back and mark your original post as resolved if your problem is fixed pete
    Reply With Quote Reply With Quote
  7. Sep 17th, 2009, 08:38 AM #7 JuggaloBrotha
    • View Profile
    • View Forum Posts
    JuggaloBrotha is offline PowerPoster JuggaloBrotha's Avatar Join Date Sep 2005 Location Lansing, MI; USA Posts 4,286

    Re: MVB syntax error on Attribute VB_name

    I have an Access 2007 form where when a button's clicked some data is concatenated into a string, of which there's more data in the string than what a MsgBox will show and I would like to have it automatically be copied to the clipboard so I can verify the contents while I'm still building the functionality of the form. I got this code: Code: Dim MyData As DataObject Set MyData = New DataObject MyData.SetText MyStringVariableHere MyData.PutInClipboard And I notice right off the bat that I get an "Object not defined error" and I found on this page http://word.mvps.org/FAQS/MacrosVBA/...eClipboard.htm that I need to add the reference to "Microsoft Forms 2.0 Object Library". Here's the problem, when I check the list of reference it's not there, where is it?
    Currently using VS 2015 Enterprise on Win10 Enterprise x64. CodeBank: All Threads • Colors ComboBox • Fading & Gradient Form • MoveItemListBox/MoveItemListView • MultilineListBox • MenuButton • ToolStripCheckBox • Start with Windows
    Reply With Quote Reply With Quote
  8. Sep 17th, 2009, 04:20 PM #8 westconn1
    • View Profile
    • View Forum Posts
    westconn1 is offline PowerPoster Join Date Dec 2004 Posts 25,618

    Re: MVB syntax error on Attribute VB_name

    as i do not have access or 2007, i can not answer this question, access is different to word or excel, but i assume there is some method to use clipboard see http://msdn.microsoft.com/en-us/library/bb258151.aspx for 2 methods
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part come back and mark your original post as resolved if your problem is fixed pete
    Reply With Quote Reply With Quote
  9. Sep 17th, 2009, 05:19 PM #9 Siddharth Rout
    • View Profile
    • View Forum Posts
    • Visit Homepage
    Siddharth Rout is offline Discovering Life Siddharth Rout's Avatar Join Date Feb 2005 Location Mumbai, India Posts 12,001

    Re: MVB syntax error on Attribute VB_name

    Can I see your dbf file for a faster resolution? Or if it is not for public view then can you mail it to me?
    A good exercise for the Heart is to bend down and help another up... Please Mark your Thread "Resolved", if the query is solved MyGear: ★ CPU ★ Ryzen 5 5800X ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X) ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor ★ Keyboard ★ TVS Electronics Gold Keyboard ★ Mouse ★ Logitech G502 Hero
    Reply With Quote Reply With Quote
  10. Sep 17th, 2009, 07:53 PM #10 JuggaloBrotha
    • View Profile
    • View Forum Posts
    JuggaloBrotha is offline PowerPoster JuggaloBrotha's Avatar Join Date Sep 2005 Location Lansing, MI; USA Posts 4,286

    Re: MVB syntax error on Attribute VB_name

    Quote Originally Posted by westconn1 View Post as i do not have access or 2007, i can not answer this question, access is different to word or excel, but i assume there is some method to use clipboard see http://msdn.microsoft.com/en-us/library/bb258151.aspx for 2 methods That article looks promising, although I did manage to finish debugging the form without copying the data to the clipboard (it was tedious though) but it's good to see an answer to this. Quote Originally Posted by koolsid View Post Can I see your dbf file for a faster resolution? Or if it is not for public view then can you mail it to me? Unfortunately I can't send anyone the file as it holds personal information that would violate the HIPAA laws if I send it to anyone.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64. CodeBank: All Threads • Colors ComboBox • Fading & Gradient Form • MoveItemListBox/MoveItemListView • MultilineListBox • MenuButton • ToolStripCheckBox • Start with Windows
    Reply With Quote Reply With Quote
  11. Sep 18th, 2009, 01:21 AM #11 Siddharth Rout
    • View Profile
    • View Forum Posts
    • Visit Homepage
    Siddharth Rout is offline Discovering Life Siddharth Rout's Avatar Join Date Feb 2005 Location Mumbai, India Posts 12,001

    Re: MVB syntax error on Attribute VB_name

    No i mean deleting the info it holds and simply uploading the structure....
    A good exercise for the Heart is to bend down and help another up... Please Mark your Thread "Resolved", if the query is solved MyGear: ★ CPU ★ Ryzen 5 5800X ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X) ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor ★ Keyboard ★ TVS Electronics Gold Keyboard ★ Mouse ★ Logitech G502 Hero
    Reply With Quote Reply With Quote
Quick Navigation Office Development Top
  • Site Areas
  • Settings
  • Private Messages
  • Subscriptions
  • Who's Online
  • Search Forums
  • Forums Home
  • Forums
  • Visual Basic
    1. Visual Basic .NET
      1. CodeBank - VB.net
    2. Visual Basic 6 and Earlier
      1. CodeBank - Visual Basic 6 and earlier
    3. TwinBASIC
      1. CodeBank - TwinBASIC
    4. Universal Windows Platform and Modern Windows Experience
    5. Xamarin
    6. Mobile Development
    7. ASP, VB Script
    8. Office Development
    9. Database Development
    10. Reporting
    11. API
    12. Games and Graphics Programming
      1. Game Demos
    13. COM and ActiveX
    14. Network Programming
    15. Visual Basic FAQs
    16. Slow Chat with the Microsoft Visual Basic team
  • .NET and More
    1. ASP.NET And ASP.NET Core
    2. Visual Basic .NET
    3. MVC .Net
    4. C#
    5. Microsoft Azure and Cloud Dev
    6. WPF, WCF, WF
    7. .NET Architecture and Design
    8. Silverlight
  • General
    1. General Developer Forum
    2. IoT, IoE, and Maker Forum
    3. Testers and Testing
    4. Application Testing
    5. Application Deployment
    6. Linux Development
    7. General PC
    8. VBForums Coding Contests
      1. Contest Entries
    9. Code It Better
    10. Maths Forum
  • Other Languages
    1. Other BASIC
    2. C and C++
    3. Java
    4. PHP
    5. XML, HTML, Javascript, Web and CSS
    6. jQuery
    7. Assembly
    8. Other Programming Languages
  • VBForums CodeBank
    1. CodeBank - Visual Basic .NET
    2. CodeBank - Visual Basic 6 and earlier
    3. CodeBank - ASP / ASP.NET / Blazor / MVC / Web API
    4. CodeBank - C#
    5. CodeBank - C++
    6. CodeBank - Java / J#
    7. CodeBank - PHP
    8. Codebank - Game Programming
    9. Codebank - Mobile Development
    10. CodeBank - JavaScript
    11. Codebank - Cascading Style Sheets (CSS)
    12. CodeBank - Other
  • VBForums UtilityBank
    1. UtilityBank - Utilities
    2. UtilityBank - IDE Add-Ins
    3. UtilityBank - Components
    4. UtilityBank - Tutorials
    5. UtilityBank - Other
  • Projects
    1. Project Requests
    2. Project Communication Area
  • Jobs
    1. Just VB Jobs
    2. Open Positions (Jobs)
    3. Looking for Work
  • Community
    1. Forum Feedback
    2. General Discussion / Chit Chat
      1. World Events
    3. Forum Test Area
« Previous Thread | Next Thread »
  • Home
  • VBForums
  • Visual Basic
  • Office Development
  • MVB syntax error on Attribute VB_name

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

Click Here to Expand Forum to Full Width
Terms of Service | About Us | Privacy Notice | Contact Us | Advertise | Sitemap| California - Do Not Sell My Info

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.

All times are GMT -5. The time now is 09:29 AM.

Từ khóa » Visual Basic Attribute Vb_name