+ Reply to Thread
Results 1 to 5 of 5

Excel Border Line style works for the first time I run the code, later it shows some error

  1. #1
    Registered User
    Join Date
    07-11-2014
    Location
    Coimbatore, India
    MS-Off Ver
    2010
    Posts
    5

    Excel Border Line style works for the first time I run the code, later it shows some error

    Hi,

    I am trying to generate a automatic report in excel format by using VB6.

    To draw borders in the excel file, I recorded a macro in one excel and found out the syntax from there.

    It works perfectly for the first time, and if dont end the program and try to generate another report it gives me an error which says "The remote server machine does not exist or unavailable".

    Anybody please help me with this..

    Error message highlights the first line of this code.

    Please Login or Register  to view this content.
    Last edited by vidyaduttk; 07-11-2014 at 01:13 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Border Line style works for the first time I run the code, later it shows some e

    Try replacing all of that with this:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-11-2014
    Location
    Coimbatore, India
    MS-Off Ver
    2010
    Posts
    5

    Re: Excel Border Line style works for the first time I run the code, later it shows some e

    Thank you very much for your reply.

    But still facing the same problem..

    It works for the first time, next time, it is giving me the same error.
    The first line of your code is getting highlighted.

    Is there some thind wrong with the way I am selecting the range. I am using this command to do it.

    ' nSheet.Cells(ro2, 3).Select'

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,282

    Re: Excel Border Line style works for the first time I run the code, later it shows some e

    If you are doing this in VB6, you aren't properly qualifying your Excel objects, which means you end up with an implicit Excel reference that can't be destroyed until your program terminates and that's why it remains in memory. You should have something like:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    07-11-2014
    Location
    Coimbatore, India
    MS-Off Ver
    2010
    Posts
    5

    Re: Excel Border Line style works for the first time I run the code, later it shows some e

    romperstomper:

    Thank you very much!!

    It worked!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Run time error 1004 - why is the last line of this code causing this?
    By SweetSorcery in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-14-2014, 06:57 AM
  2. [SOLVED] run time error 91 - but code works in another spreadsheet ?
    By pmasrich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2013, 07:32 AM
  3. [SOLVED] Excel 2010: Run-time error at .Chart.Paste line within With statement (works on 2003/2007)
    By JohnMcCallum in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2012, 11:53 AM
  4. Why do I get Run-time error 91 on this line of code?
    By ThomasHaller in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-17-2012, 04:48 PM
  5. excel 2007 frame border style
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2009, 03:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1