RE: My Problem - Help Please



I think that you are going about it the wrong way. Try using a combo box for
the selection and then the user is restricted to valid selections. If you
can't work out how then let me know what version of xl you have and I'll see
if I can provide you with some help.

Regards,

OssieMac

"Launchnet via OfficeKB.com" wrote:

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