Jump to content


Photo
- - - - -

Excel


2 replies to this topic

#1 Steve Houghton

Steve Houghton

    Advanced

  • Validating
  • PipPipPip
  • 52 posts
  • Gender:Male
  • Location:United Kingdom

Posted 07 April 2008 - 11:49 AM

Hi Guys

has anybody created Excel spreadsheets from Pro-IV using DDE's with a variable filename and managed to populate them and save them without any user input at all.

I have no problems creating the spreadsheet as book1 but now I need to use a specific names and want to close Excel without any user input at all.

If anybody out there has done this I would be pleased to know how.

I am using Pro-IV 5.5 on Red Hat Linux with a 5.5 Client running Window XP professional with Excel 2003.

Thanks

Steve Houghton

#2 David Allen

David Allen

    Member

  • Members
  • PipPip
  • 13 posts
  • Gender:Male
  • Location:Leeds, United Kingdom

Posted 07 April 2008 - 02:01 PM

Steve,

Just enter code similar to the following:

$$FILENAME = '"' + 'C:\temp\' + CMPR-JOBNO + '-DocRec.xls' + '"'
$$COMMAND = '[SAVE.AS(' + $$FILENAME + ',1,"",False,"",False)]' 
#A = DDE_EXECUTE('EXCEL','SYSTEM',$$COMMAND)
$$COMMAND = '[QUIT()]'
#A = DDE_EXECUTE('EXCEL','SYSTEM',$$COMMAND)


This will save the file as 'c:\temp\n28-DocRec.xls' and then closes excel (CMPR-JOBNO is a file field in our system containing 'n28').

If you look round the forum you'll find lots of examples of dde commands. One such posting by Andy Jones pointed me to this help file containing a complete list of dde commands that can be used as the command within the square brackets. I've found it invaluable and gives you the tools to do all sorts of fantastic stuff.

http://support.micro...s/Q128/1/85.asp


HTH,

David

#3 Steve Houghton

Steve Houghton

    Advanced

  • Validating
  • PipPipPip
  • 52 posts
  • Gender:Male
  • Location:United Kingdom

Posted 07 April 2008 - 03:17 PM

Hi David

It works a dream - many thanks for your help

Regards

Steve



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users