RE: My Problem - Help Please
- From: "Launchnet via OfficeKB.com" <u20911@uwe>
- Date: Mon, 16 Jul 2007 18:27:38 GMT
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.[quoted text clipped - 60 lines]
Column A's width is set at 1 or 12 pixels. It's not necessary
End Sub
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200707/1
.
- Follow-Ups:
- RE: My Problem - Help Please
- From: OssieMac
- RE: My Problem - Help Please
- References:
- My Problem - Help Please
- From: Launchnet via OfficeKB.com
- RE: My Problem - Help Please
- From: OssieMac
- My Problem - Help Please
- Prev by Date: Re: Using a dynamic pathname in VLOOKUP
- Next by Date: Re: A formula to look for a value in a blok (eg E1:J10) data
- Previous by thread: RE: My Problem - Help Please
- Next by thread: RE: My Problem - Help Please
- Index(es):
Loading