C
Curare
I am trying to build code that would create reports from excel base
calculations. I have a standard format of the report whereby onl
numbers have to be posted to it.
Sub RunXL()
Dim myWB As Excel.Workbook
Set myWB = GetObject("C:\Temp\XLtoWrd.xls")
Selection.GoTo _
what:=wdGoToBookmark, _
Name:="Amt"
Selection.TypeText (myWB.Sheets("Sheet1").Range("Amt"))
Selection.GoTo _
what:=wdGoToBookmark, _
Name:="Dys"
Selection.TypeText (myWB.Sheets("Sheet1").Range("Over"))
Set myWB = Nothing
End Sub
My question is how can I allow for file browsing in the code? I don'
want to keep sending my final excel files to the temp directory. I'v
tried using GetOpenFilename, but I get a "Method or data member no
found" error.
A follow up to this question is about the bookmarks. I want a specifi
bookmark shown in several areas, but Word just moves it. For instance
in the example above, I want "Amt" shown on three separate pages, bu
Word only allows for the most recent bookmark assignment I gave it. I
there a way to go about this?
Thanks
calculations. I have a standard format of the report whereby onl
numbers have to be posted to it.
Sub RunXL()
Dim myWB As Excel.Workbook
Set myWB = GetObject("C:\Temp\XLtoWrd.xls")
Selection.GoTo _
what:=wdGoToBookmark, _
Name:="Amt"
Selection.TypeText (myWB.Sheets("Sheet1").Range("Amt"))
Selection.GoTo _
what:=wdGoToBookmark, _
Name:="Dys"
Selection.TypeText (myWB.Sheets("Sheet1").Range("Over"))
Set myWB = Nothing
End Sub
My question is how can I allow for file browsing in the code? I don'
want to keep sending my final excel files to the temp directory. I'v
tried using GetOpenFilename, but I get a "Method or data member no
found" error.
A follow up to this question is about the bookmarks. I want a specifi
bookmark shown in several areas, but Word just moves it. For instance
in the example above, I want "Amt" shown on three separate pages, bu
Word only allows for the most recent bookmark assignment I gave it. I
there a way to go about this?
Thanks