RE: My Problem - Help Please



Thanks OssieMac . . .
Everything works, eccept when the user clicks where there is not a Path &
File Name. An error message is then given.

The following is the code I used. Can you show me how to check for this
error or check for blank cell so that the user gets a message like . . .
"You have not clicked a valid cell."
Then, the the operator clicks Ok Button and the macro simply resets and
returns the user to the *** the user is working with.

I understand basically how it's done, but I can' find an actual sample in
Help.

CODE USED:
Sub NewExcelWithWorkbook()
Dim oXL As Object
Dim oWB As Object

ActiveCell.Offset(0, -1).Activate
Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
Set oWB = oXL.Workbooks.Open(ActiveCell)

End Sub

Can you please show me the code and where the message code
should go?

I appreciate this very much.

Thanks Matt@Launchnet

OssieMac wrote:
YOUR EXAMPLE:
Set oWB = oXL.Workbooks.Open("GET THE PATH AND CODE
FROM THE CURRENT ACTIVE OR SELECTED CELL IN COLUMN A HERE")

Try this:
Set oWB = oXL.Workbooks.Open(ActiveCell)

or you can set a variable to equal the ActiveCell and then use the variable

Dim wbToOpen as String

wbToOpen = ActiveCell

Set oWB = oXL.Workbooks.Open(wbToOpen)

The above is untested but I think that it will point you in the right
direction.

Regards,

OssieMac

In Cell A5, I have c:\my documents\specialhandout.xls.
Column A's width is set at 1 or 12 pixels. It's not necessary
[quoted text clipped - 60 lines]

End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200707/1

.


Loading