Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default Macro fine Run fine from Select but not from KB Shortcut?

2003 & 2007

What could cause a macro fine run fine from "Select Run" but not from KB Shortcut?

Just in case, I changed the KB Shortcut but still the issue.

BTW same result on different computers.

Any thoughts appreciated!

EagleOne
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Macro fine Run fine from Select but not from KB Shortcut?

Make sure the short-cut is not assigned to two macros.
--
Gary''s Student


" wrote:

2003 & 2007

What could cause a macro fine run fine from "Select Run" but not from KB Shortcut?

Just in case, I changed the KB Shortcut but still the issue.

BTW same result on different computers.

Any thoughts appreciated!

EagleOne

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro fine Run fine from Select but not from KB Shortcut?

Does your code open another workbook and fail right after it opens that
workbook?

Does your shortcut key include the shift key?

If yes, then remove the shiftkey from the shortcut key combination.

Holding the shift key while opening a workbook stops the open macros
(workbook_open/auto_open) from running. And it can confuse excel enough so
that it doesn't know to continue with the remainder of your original code.

This is a problem with xl2003 (and below). I don't use xl2007 to know for sure.

If this doesn't help, I think you'll have to give more info.

wrote:

2003 & 2007

What could cause a macro fine run fine from "Select Run" but not from KB Shortcut?

Just in case, I changed the KB Shortcut but still the issue.

BTW same result on different computers.

Any thoughts appreciated!

EagleOne


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default Macro fine Run fine from Select but not from KB Shortcut?

(Gary's Student) Since I have switched keys that should not be the issue.
Thanks for our thoughts


Hello Dave,

Does your code open another workbook and fail right after it opens that
workbook? YES

Does your shortcut key include the shift key? YES

Got your thoughts on the "Shift" key.

What is the issue "open another workbook?"

In fact, the macro opens a text file using an array which is ultimately Saved As .xls

EagleOne


Dave Peterson wrote:

Does your code open another workbook and fail right after it opens that
workbook?

Does your shortcut key include the shift key?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default Macro fine Run fine from Select but not from KB Shortcut?

Just for devilment,

If I wanted to, how would I use (do I need to) ReDim or ReDim Preserve
to "clear" the array from memory with the array next?

Workbooks.OpenText FileName:="C:\Hold\Directory Listing.txt", _
Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
Array(Array(0, 1), Array(10, 1), Array(11, 1), thru Array(39, 1))

EagleOne


Dave Peterson wrote:

Does your code open another workbook and fail right after it opens that
workbook?

Does your shortcut key include the shift key?

If yes, then remove the shiftkey from the shortcut key combination.

Holding the shift key while opening a workbook stops the open macros
(workbook_open/auto_open) from running. And it can confuse excel enough so
that it doesn't know to continue with the remainder of your original code.

This is a problem with xl2003 (and below). I don't use xl2007 to know for sure.

If this doesn't help, I think you'll have to give more info.

wrote:

2003 & 2007

What could cause a macro fine run fine from "Select Run" but not from KB Shortcut?

Just in case, I changed the KB Shortcut but still the issue.

BTW same result on different computers.

Any thoughts appreciated!

EagleOne



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default Macro fine Run fine from Select but not from KB Shortcut?

Dave,

The Shortcut w/o the shift key worked.

Only if you have time (silly me) I would like to know about why the "open file" issue.

Thanks

Dave Peterson wrote:

Does your code open another workbook and fail right after it opens that
workbook?

Does your shortcut key include the shift key?

If yes, then remove the shiftkey from the shortcut key combination.

Holding the shift key while opening a workbook stops the open macros
(workbook_open/auto_open) from running. And it can confuse excel enough so
that it doesn't know to continue with the remainder of your original code.

This is a problem with xl2003 (and below). I don't use xl2007 to know for sure.

If this doesn't help, I think you'll have to give more info.

wrote:

2003 & 2007

What could cause a macro fine run fine from "Select Run" but not from KB Shortcut?

Just in case, I changed the KB Shortcut but still the issue.

BTW same result on different computers.

Any thoughts appreciated!

EagleOne

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro fine Run fine from Select but not from KB Shortcut?

This issue is still this:

Holding the shift key while opening a workbook stops the open macros
(workbook_open/auto_open) from running. And it can confuse excel enough so
that it doesn't know to continue with the remainder of your original code.

Since your shortcut key includes the shiftkey, excel thinks that it should stop
the auto_open/workbook_open procedures in the newly opened workbooks from
running. And since it stopped those procedures, it's gonna stop the rest of
yours, too. (That's the confusion part.)





wrote:

(Gary's Student) Since I have switched keys that should not be the issue.
Thanks for our thoughts

Hello Dave,

Does your code open another workbook and fail right after it opens that
workbook? YES

Does your shortcut key include the shift key? YES

Got your thoughts on the "Shift" key.

What is the issue "open another workbook?"

In fact, the macro opens a text file using an array which is ultimately Saved As .xls

EagleOne

Dave Peterson wrote:

Does your code open another workbook and fail right after it opens that
workbook?

Does your shortcut key include the shift key?


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro fine Run fine from Select but not from KB Shortcut?

Nope. You don't need to clear that array of arrays.

Just specify the new one.

But if you ever want to empty an array variable that you used, you can erase it.

Dim myArray(1 to 3) as long

myarray(1) = 99
myarray(2) = 3
myarray(3) = -43

erase myarray

But your code doesn't even use a variable to hold the array.

It's kind of like hardcoding the value into a comparison:

Dim myVal as string
myval = "something"
if myval = "ok" then
....

compared to:
dim myVal as string
dim myOtherVal as string

myval = "onething"
myotherval = "anotherthing"

if myval = myotherval then
....

in that case, you may want to clear that variable.
myotherval = ""
(similar in function to erase myArray)



wrote:

Just for devilment,

If I wanted to, how would I use (do I need to) ReDim or ReDim Preserve
to "clear" the array from memory with the array next?

Workbooks.OpenText FileName:="C:\Hold\Directory Listing.txt", _
Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
Array(Array(0, 1), Array(10, 1), Array(11, 1), thru Array(39, 1))

EagleOne

Dave Peterson wrote:

Does your code open another workbook and fail right after it opens that
workbook?

Does your shortcut key include the shift key?

If yes, then remove the shiftkey from the shortcut key combination.

Holding the shift key while opening a workbook stops the open macros
(workbook_open/auto_open) from running. And it can confuse excel enough so
that it doesn't know to continue with the remainder of your original code.

This is a problem with xl2003 (and below). I don't use xl2007 to know for sure.

If this doesn't help, I think you'll have to give more info.

wrote:

2003 & 2007

What could cause a macro fine run fine from "Select Run" but not from KB Shortcut?

Just in case, I changed the KB Shortcut but still the issue.

BTW same result on different computers.

Any thoughts appreciated!

EagleOne


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shortcut to Excel macro? markvi Excel Discussion (Misc queries) 2 August 25th 06 09:30 PM
Rookie at linking - need a tudor!!! The Smuffer Excel Worksheet Functions 9 March 7th 06 08:04 PM
Restarting a macro BR Excel Worksheet Functions 19 December 23rd 05 09:57 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM


All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"