DDEPOKE for Excel

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Alistair
Newbie
Posts: 4
Joined: Sat May 29, 2004 12:13 am

DDEPOKE for Excel

Post by Alistair » Sat May 29, 2004 12:25 am

I'm trying to update a worksheet in a workbook without sucess

DDEPoke>Excel,C:\My Documents\310504.xls,'Saturday Till'!R3C3,1234

This is what I have tried. Does anyone know the correct syntax for DDEPoke where you need to specify a particular worksheet in the workbook

Many thanks,

Alistair

Lumumba

Post by Lumumba » Wed Jun 02, 2004 7:18 am

I've currently no idea if its possible to call a worksheet directly. Maybe this workaround helps:

Press CTRL+PgUp/PgDown to cruise through the available worksheets
Press ALT+OHR to "rename" the sheet and CTRL+C to transfer the name of the worksheet to the clipboard (to identify which one is currently active)
Press ESC to leave the worksheets label
.
.
.

Lumumba

Post by Lumumba » Wed Jun 02, 2004 7:22 am

Or have look at this [more...] :wink:

Alistair
Newbie
Posts: 4
Joined: Sat May 29, 2004 12:13 am

Post by Alistair » Sat Jun 26, 2004 12:33 am

Many thanks for the tips

Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Post by Rory » Thu May 11, 2006 2:15 pm

I know that this question is 2 years old but I do have an answer to help out.

You can create a macro inside of Excel to direct you to a specific sheet and then fire this "Excel" macro off with a keyboard short cut. The keystrokes can be sent with MS

Here is an example:

Sub test()
Sheets("Sheet1").Select
End Sub

You can even have it go to a perticular cell too!

Sub test()
Sheets("Sheet1").Select
Range("A1").Select
End Sub


Rory

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu May 11, 2006 2:27 pm

You can even do all that directly within Macro Scheduler with no need to add any macros to Excel or modify the Excel file at all:

VBSTART

Sub xlExample

Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = true
oExcel.Workbooks.Open "c:\my documents\excelexample.xls"
oExcel.Sheets("Sheet2").Select
oExcel.Range("A1").Select

End Sub

VBEND

VBRun>xlExample

This example starts Excel, opens excelexample.xls, selects Sheet 2 and highlights Range A1.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu May 11, 2006 3:11 pm

This could be viable alternate solution but unfortunately it doesn't help with DDE which doesn't care which sheet is on top, it only cares which sheet is the first (leftmost tab) in the book. Not a complaint, just trying to avoid confusion.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Thu May 11, 2006 6:37 pm

I am at the "wrong" PC right now, but there is a VERY simple solution to addressing specific sheets. I have this code from many many months ago. Actually DDERequest can read directly from Excel, no VBScript. Just add a setting in the command. I'll find it later and post it. It may already be here in the forum somewhere.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts