Controlling Excel via Word

B

BMC

Hi

I've a user with got a bunch of word documents which need to be put into a
completely different layout in an Excel worksheet. I was volunteered to find
a way of automating this as much as possible.
I've already got the change of layout sorted, then I save it as a temporary
..csv file as plain text, and get Excel to open this. This all works.
What I can't do is get Excel to show its FileSaveAs dialog. I need this as
the user to choose a file name for each document, and make sure he saves it
as an xls.

Set exc = CreateObject("Excel.Application")
Set xlWB = exc.Workbooks.Open("convertmacrotemp.csv")
exc.Visible = True
exc.Dialogs(xlDialogSaveAs).Show

Excel starts, opens the document and becomes visible, but stops there. In
The VBA editor I get a Run-time error '1004' (Application-defined or
object-defined error).
From an Excel macro, it is quite happy to show the dialog if I do
Application.Dialogs(xlDialogSaveAs).Show

What's wrong? Any ideas very gratefully received.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top