Results 1 to 6 of 6

Thread: Word problem....

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    16

    Word problem....

    Hi, folks
    I used VB to generate a word document with around 50 tables inside.

    My problem is that the generation of the document is not stable.
    Most of the time it is error-free, but sometimes errors will raise during the " Cell Merge" procedure. It is for the same task, i just want to check whether it is stable so i run it for several times.


    I think that is nothing wrong with the codes, otherwise it can not be error-free.

    So what may be the reason for such kind problem??

    Will the setting fot "Odoc.Visuable" effects the
    document generation???



    Sami.
    sami

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    16
    Sorry... It is "oDoc.Visible" instead of "Odoc.Visuable".



    Sami.
    sami

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Don't know, unless we can see some code?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    16
    Originally posted by RobDog888
    Don't know, unless we can see some code?

    Hi,RobDog888,
    Thanks for ur reply.
    I try several times and find out that if
    i set the "ActiveDocument.Visible = True " then
    the excution will be error-free.
    Otherwise the error message would like this:

    *****************************
    Runtime error '4605':
    This command is not available.

    *****************************

    And the error command in my code is :

    ***************************
    Selection.Cells.Merge

    ***************************


    This comamd excutes well if i set
    "ActiveDocument.visiable = True".



    So i think the setting of "ActiveDocument.visiable"
    will effect the excution.

    I dun know why Word VBA got such problem...
    It is better to set the
    "ActiveDocument.visiable = false "
    during the excution of my program.


    My project is confidencial in my company,
    so i can not show you here.
    Sorry about that.

    Thanks a lot... any way.


    Sami.
    sami

  5. #5
    Member
    Join Date
    May 2004
    Location
    Dubai, United Arab Emirates
    Posts
    33
    Your problem doesn't seem to be very difficult provided code is looked at.

    Pasting your code on the board will not affect the confidentiality of the file.

    Best Regards,

    S h a n

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    If you are using the Selection object or moving etc. then the
    document HAS to be active and visible. No way around it.

    You can always post code with any sensitive data changed to
    protect the innocent.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width