Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to control Word via DDE in MS Access

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-11-2010
Member
 
Join Date: Sep 2010
Posts: 12
How to control Word via DDE in MS Access
  

I am in Access 2010 and wants to control Word via DDE. So I have written a code in Access (all just stolen) . But unfortunately breaks me off even at DDE Initiate, it could not find the application and the specified topic. What am I doing wrong? Is there any sample code for Access 2010? The following is the code that I am trying :
Code:
As Long Dim lngChannel 
lngChannel DDEInitiate = ("Excel", "System") 

DDEExecute lngChannel '[OPEN ("& Chr (43) &" C: \ Documents \ Book1.xls "& Chr (43) &")] " 
DDETerminate lngChannel 

lngChannel DDEInitiate = ("Excel", "Book1.xls") 
MsgBox DDERequest (lngChannel, "R1C1") 
DDETerminateAll
I am looking out for some help, tried to search it on internet but didn't find any appropriate solutions. So this is my last hope, please help me soon.

Reply With Quote
  #2  
Old 28-11-2010
Member
 
Join Date: Feb 2010
Posts: 531
Re: How to control Word via DDE in MS Access

The simplest workaround:
Code:
 Sub TestDDE () 
  As Long Dim lngChannel 
  ObjWord As Object Dim 

  Set objWord = CreateObject ("Word.Application") 
  lngChannel DDEInitiate = ("WinWord", "System") 

  'Here your DDE actions 

  DDETerminate lngChannel 
  objWord.Quit 
  Set objWord = Nothing 
  End Sub
The procedure runs without errors for me. I am sure that you too were looking for the same code. Also I checked your code..
lngChannel DDEInitiate = ("Excel", "System")
If I open Excel before this line continues to run the code. I think that you should try changing the variables.
Reply With Quote
  #3  
Old 28-11-2010
Member
 
Join Date: Sep 2010
Posts: 12
Re: How to control Word via DDE in MS Access

I have a database on the network for multiple users. So that the database can be used by several people I will start a macro when the call from the related tables (Excel) data in an Access table writes. My problem is if someone already has the database open is the start of the macro mist, as the second user now gets an error message and can not use the DB. My question is there a VBA macro command I can put the front of the macro says only start when the table is not used or if no other user is accessing the database.?
Reply With Quote
  #4  
Old 28-11-2010
Member
 
Join Date: Feb 2010
Posts: 125
Re: How to control Word via DDE in MS Access

I was also having the similar issue. So that with the FE and BE, I just made, but it initially pushes only the tables in the BE, the linked Excel tables remain so in the FE and if I now start macro (for the update of tables) sharp turn I have again the problem of the second a macro error gets reported and can utilize the database can not. You can also link to Excel spreadsheets so BE and from there returning to the BE. So the macro does nothing else but a table update query the data from the Excel spreadsheet into an Access table to conjure to then access it again. Since I have found the so all tables can work with, but when I put the info directly to Excel shortcuts take off I get the error, the Excel table is being used exclusively.
Reply With Quote
  #5  
Old 28-11-2010
Member
 
Join Date: Feb 2010
Posts: 155
Re: How to control Word via DDE in MS Access

OK, in VBA could catch the error and ignore the. Even do not get a more user an error message on the site. Alternatively, you write to the above update a value in a table and check off. If it does exist, was the Update query already executed, perform otherwise. Also if you are looking for the code, this will definitely help you :
Code:
Private Sub Form_Open (Cancel As Integer) 

'Check if current date is in the table 
If Nz (DMax ("ActDate", "tblUpdate")) <> Date Then 
'Leave now already Action Date 
CurrentDb.Execute "INSERT INTO tblUpdate (ActDate)" & _ 
"VALUES (date ());" 
'And here's your import code 
stDocName = "create table" 
DoCmd.SetWarnings False 
DoCmd.RunMacro stDocName 
DoCmd.SetWarnings True 

End if 
End Sub
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to control Word via DDE in MS Access"
Thread Thread Starter Forum Replies Last Post
how to repair a product of Microsoft Office Word(beta) 2010 via Control Panel Garlanka Windows Software 4 06-12-2011 07:07 AM
What is Media Access Control and Logical Link Control Pakhi Networking & Security 4 10-01-2011 11:53 AM
No access to Fan Control from BIOS Frieda Operating Systems 5 05-11-2010 01:36 AM
Control Access through Remote Access Policy grayed out Amie Operating Systems 3 01-08-2009 09:18 PM
Regain control of Word 2003 - Word 2007 Conrad Tips & Tweaks 0 03-01-2009 01:20 PM


All times are GMT +5.5. The time now is 07:52 PM.