Consulting

Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 21 to 40 of 55

Thread: Turn on Resources on Install

  1. #21
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    then how do I get it to work with the reference turned off. I get an object required error

  2. #22
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Probably because you have qualified it with the application object.

  3. #23
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    ok so how do I unqualify it?

  4. #24
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I meant haven't not have.

  5. #25
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I think Bob's saying you have to dim it as an object too...just as you did in this code for the email object:
    [VBA]Dim OL As Object
    Dim EmailItem As Object
    Dim WB As Workbook
    TurnOffFeatures
    Set OL = CreateObject("Outlook.Application")
    Set EmailItem = OL.CreateItem(0)
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  6. #26
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I was assuming he had already done that Steve, although I was thinking Word, and that he just needed to pre-pend Documents with that object variable.

  7. #27
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    so would this be what you mean

    [VBA]dim Documents as object[/VBA]

  8. #28
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Just trying to cover the bases Bob....I didn't see in his previous code where he had dealt with the Word object so I thought I would remind him of the concept...not meaning to step on toes.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  9. #29
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Nor did I Steve, he hasn't mentioned it specifically, hence my obtuseness borne of lack of information.

  10. #30
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Reading between the lines in not my best suite. It seems they think we can look over thier shouders somtimes and see what they are doing.....

    Several regular supporters here have signatures that refer to complete descriptions of what your trying to do but if you don't get the info you have to work in the dark.....time consuming and frustrating.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  11. #31
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Djblois
    so would this be what you mean

    [vba]dim Documents as object[/vba]
    No, no!

    Letr's assume, because you haven't told me, that you have started word from your code and have a Word object. Let us further assume that that object is called oWord (spooky stuff!).

    IF these assumptions are correct, you probably want

    oWord.Documents.Open (blah blah blah)

  12. #32
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    no I haven't started word yet but I guess I need to?

  13. #33
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    How do I start word programatically?

  14. #34
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    create object....just as you did with outlook..
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  15. #35
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Djblois
    no I haven't started word yet but I guess I need to?
    You do if you are working with Word documnts. Are you sure that is what you need?

  16. #36
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    THis is what I have now and it is I think opening the file hidden:

    [VBA]Sub Instructions()

    Set WD = CreateObject("Word.Application")
    TurnOffFeatures

    On Error Resume Next
    WD.Documents.Open ("H:\@Business_Reporting_Today\References\Business Reporting Today.doc")
    TurnOnFeatures

    End Sub[/VBA]

    I think that because it doesn't show the first time I run it and if I run it again it says it is locked for editing by me.

  17. #37
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Add
    WD.Visible = True

    after creating the Word instance.

  18. #38
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    that works perfectly but now I want to create it so it checks if it is open already and if it is already open then it will switch to it. I know how to do this with excel but not with word.

  19. #39
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Same, just Word.Application not Excel.APplication.

  20. #40
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    PS when you go consulting I claim 10% of your income.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •