Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2004, 10:06 AM
Registered User
 
Join Date: Nov 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default 'Remote server machine does not exist...'

I have been running Excel automation code in Access to create some reporting. Specifically I am using code to send tables to an existing spreadsheet, open it, and run pivot table.
     Sometimes when this procedure runs it fails and I receive an error that the 'Remote server machine does not exist or is unavailable.' This occurs about half the time I run this process and occurs whether its run across a network or on a local machine. Does anyone know the cause of this or how to prevent it?
     Microsoft says it has to do with network settings which I don't buy because it happens when not on a network as well. Any suggestions are appreciated.
 
Old December 13th, 2004, 05:09 AM
Authorized User
 
Join Date: Aug 2004
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Don't really know the answer, but in the absence of other replies ...
it may be that the code is running too fast for the server. Try adding a line of code after that for the connection to delay activity eg. 3 seconds :-
Code:
Application.Wait Now + TimeValue("00:00:03")

-----------------------
Regards BrianB
Most problems occur from starting at the wrong place.
Use a cup of coffee to make Windows run faster.
It is easy until you know how.
 
Old December 13th, 2004, 02:14 PM
Registered User
 
Join Date: Nov 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Interesting idea. I appreciate the help, I'll give it a try.
 
Old December 29th, 2004, 09:29 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This looks like a new Microsoft problem (WinXP SP"??) because I've used GetObject/ CreateObject to do this kind of thing many times before without coming across this "" problem.

I am currently opening Word from Excel and popping in some data which then is converted into a table. It lets me convert the table (ie it finds the Word object) but gives the error when I ask it to change the column widths. If I manually take it through that stage it then carries on adding the rest of the data without any problem. Oh and I'm not doing this over a network (yet) - it's all on a one disk and one PC!

It works ok first time in a Windows session which makes me suspicious of the SP2 thing. I've set my object variable to Nothing so I don't think it's "untidiness". I'm using Office 2000 in WinXP but may get a chance later to run it in Office XP. (also I did read somewhere that Office 2003 has a CreateObject problem)

Regards

Rogen
 
Old December 29th, 2004, 01:19 PM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've found the answer but possibly only to my own problem with "The remote server machine does not exist or is unavailable"

I've been checking my code and have realised I hadn't preceded use of the CentimetersToPoints method with my App object name as in wrdApp.CentimetersToPoints. Most of the code uses Excel's VBA routines but CentimetersToPoints is a Word method - whoops.

Still you never know - check your code??

Regards

Rogen
 
Old June 13th, 2006, 09:19 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The last posting really did the trick in helping me out!
I was using (copy/pasted) code referencing ActiveDocument.Styles(wdStyleHeading8) to access a built-in style name - but ActiveDocument is not set in this context.
Instead, the document object I created earlier with CreateObject needed to be used, as in myWordDoc.Styles(wdStyleHeading8)
Quite an obvious coding error, actually - but the message not really helped tracking it down.
 
Old November 4th, 2011, 02:08 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Nothing works

The above ideas do not work in my case. I have the following code in Access, and it runs for the first time, but not for the second time. Any one knows the cause and solution?
I am using Office 2010. Thanks.

dim objChart as Excel.Chart
Set objChart = Excel.Charts.Add

--------------------------------------

I found this. http://support.microsoft.com/default.aspx?kbid=178510

Last edited by smithers; November 4th, 2011 at 02:34 AM.. Reason: found an answer
 
Old September 13th, 2013, 09:05 AM
Registered User
 
Join Date: Sep 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check documents

I had a similar problem with a user trying to attach/open a Word document to a claim record in an MS Access database.. I discovered that the problem only occurred if the document being opened had been created in a previous version of MS Word to that currently in use (2010 in my case) and was being opened by VBA office automation code.
If you opened the document directly in MS Word 2010 there was no problem and if you then saved it as a .docx (ie 2010) document the vba office automation code worked without a hitch. Renaming .doc to .docx documents without first converting via Word 2010 did not work.
What I suspect is happening is that the office automation code is looking at the version of Word the document was created in and then trying to open this specific version of MS Word to display the document in. If that version of MS word is not available (because you have upgraded for instance) then it throws the error you see. This is onlay a guess





Similar Threads
Thread Thread Starter Forum Replies Last Post
Retore Db from a remote machine to a local machine srkvellanki BOOK: Beginning SQL 0 October 3rd, 2008 05:17 PM
Error # 462 - Remote Server does not exist or is u doncar38 Word VBA 3 January 17th, 2008 08:04 AM
SQL Server Access across a remote machine rajen SQL Server 2000 3 July 27th, 2006 02:28 PM
Error 462 : Remote server doesn't exist ldk2004 BOOK: Expert One-on-One Access Application Development 0 December 17th, 2004 01:21 PM
'Remote server machine does not exist..." GandolftheWhite Pro VB Databases 0 November 15th, 2004 12:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.