Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 04 FEB 2021 01:44:39PM Bruce Cameron wrote:

Hello,

Am looking to modify an existing Excel workbook/spreadsheet on the fly, using OI OLE.

Having some trouble getting it to Save. The following isn't working. Do need to use another method?

Res = OleCallMethod(oWBook,'SAVE',0)

Res = OleCallMethod(oWBook,'CLOSE',0)

Res = OleCallMethod(oWkbks,'SAVE',0)

Res = OleCallMethod(oWkbks,'CLOSE',0)

QuitDoc = OleCallMethod(oXl, 'QUIT', 0)

Thanks,

b. cameron

www.alternativesystems.net

603-433-0014


At 04 FEB 2021 02:52PM bob carten wrote:

Hi Bruce,

I could not find an example offhand. I remeber the steps as save the workbook, quit excel with a nowarn flag. Can you record a macro in excel, use that as the basis?


At 04 FEB 2021 03:36PM Bruce Cameron wrote:

Hi Bob!!

After some playing/testing this seems to work…

x = OleCallMethod(oWBook,"Save")

Res = OleCallMethod(oWBook,'CLOSE',0)

x = OleCallMethod(oWkBks,"Save")

Res = OleCallMethod(oWkbks,'CLOSE',0)

Call Sleepery(1)

QuitDoc = OleCallMethod(oXl, 'QUIT', 0)

Problem now is, the Word document that has the (this) Excel charts embedded in it (that I just updated on the fly), is not grabbing it. I thought it would read that Excel file at the time of the mailmerge and pull in the specific chart data.

Any ideas on that? Have you ever done that? Added a dynamic Excel chart to a Word doc?

Thanks! Hope all is well on your end.

b. cameron

www.alternativesystems.net

603-433-0014


At 04 FEB 2021 03:43PM Bruce Cameron wrote:

Scratch that last question. I got it. I had to "Link to File" in Word.

90% there now.

Thanks

b. cameron

www.alternativesystems.net

603-433-0014

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/a566f2b509df6748a79dad6bafdf986d.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1