Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Extremly stupid VBA question

Extremly stupid VBA question

Scheduled Pinned Locked Moved Visual Basic
questionsecurity
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harald Krause
    wrote on last edited by
    #1

    Why does this not work? Dim appword As Object Public Sub start() Set appword = CreateObject("Word.Application") If appword Is Nothing Then MsgBox "appword = Nothing" Else appword.Visible = 1 End If MsgBox "Test" MsgBox "Test2" End Sub --- appword is allways nothing, CreateObject does not work... Is there any hidden security setting in Office 2000 I dont know? bb |~ bb

    M N 2 Replies Last reply
    0
    • H Harald Krause

      Why does this not work? Dim appword As Object Public Sub start() Set appword = CreateObject("Word.Application") If appword Is Nothing Then MsgBox "appword = Nothing" Else appword.Visible = 1 End If MsgBox "Test" MsgBox "Test2" End Sub --- appword is allways nothing, CreateObject does not work... Is there any hidden security setting in Office 2000 I dont know? bb |~ bb

      M Offline
      M Offline
      MrGee
      wrote on last edited by
      #2

      Dim appword As Object should come after Public Sub start()

      R 1 Reply Last reply
      0
      • H Harald Krause

        Why does this not work? Dim appword As Object Public Sub start() Set appword = CreateObject("Word.Application") If appword Is Nothing Then MsgBox "appword = Nothing" Else appword.Visible = 1 End If MsgBox "Test" MsgBox "Test2" End Sub --- appword is allways nothing, CreateObject does not work... Is there any hidden security setting in Office 2000 I dont know? bb |~ bb

        N Offline
        N Offline
        Nick Seng
        wrote on last edited by
        #3

        Did you add a reference to Word10 ? Then you can just declare it like so:

        Dim appWord as Word.Application

        Set appWord = New Word.Application

        Nick Seng (the programmer formerly known as Notorious SMC)


        God, I pity me! - Phoncible P. Bone

        1 Reply Last reply
        0
        • M MrGee

          Dim appword As Object should come after Public Sub start()

          R Offline
          R Offline
          RichardGrimmer
          wrote on last edited by
          #4

          NOt necessarily - could be a member variable of his form, and not just a local - maybe it needs to be used by other functions / subs "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups