Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharing a Workbook that Contains Macros

Status
Not open for further replies.
Jun 12, 2003
16
CA
Hi,

I am using Excel 97.

I have a workbook that contains 4 small macros that act as advance filters to create lists based on certain criteria. I would like to share this workbook so that more than 1 person can work on the workbook at the same time.

I know that macros become disabled when you share workbooks but I was wondering if anyone has faced this issue and has overcome it in some way or another.

I have thought of a possible solution but I have no idea if it is even possible to accomplish. My solution is to place the macros and list worksheets in a seperate non-shared workbook. Users would then use the macros to filter out information contained in the shared workbook and display the list in the non-shared workbook.

Once again, I do not know if this is even possible. Can someone tell me if this is a possible solution and if so, how would I go about doing this? If it is not possible, can someone please tell me a way around the sharing/macro issue?

I know I can just assign a password and tell the users that they cannot be using the workbook at the same time but I would like to avoid this.

Thank You.
 
SkipVought,

I shared the workbook and tried to execute the macro to run the Advance Filter so that I can create a list and I got the following error message:

"Run-time error '1004': AdvanceFilter method of Range class failed".

Any help on what this means exactly and how it can be solved would be greatly appreciated.

Thank You.
 
Here are the 3 macros I am using. When the error message pops up, it won't let me debug (I'm guessing because the workbook is shared) but the macros work fine when the workbook is not being shared.

MACRO #1
Sub additiongenerator()
'
' additiongenerator Macro
'
' Keyboard Shortcut: Ctrl+w

'
Range("additiondata").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("A1:H2"), CopyToRange:=Range("A14:I1029"), Unique:=False
Range("A2").Select
ActiveWindow.LargeScroll Down:=-1
Range("A2").Select
End Sub

MACRO #2
Sub deletionlistgenerator()
'
' deletionlistgenerator Macro
'
' Keyboard Shortcut: Ctrl+l

'
Range("D18").Select
Range("deletiondata").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("A1:G2"), CopyToRange:=Range("A18:M1033"), Unique:=False
End Sub

MACRO #3
Sub summarylist()
'
' summarylist Macro
'
' Keyboard Shortcut: Ctrl+q

'
Range("additiondata").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("A1:G2"), CopyToRange:=Range("A23:i1100"), Unique:=False
Range("deletiondata").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("A1:G2"), CopyToRange:=Range("L23:T1100"), Unique:=False
End Sub

Thank You Once Again
 
Skip,

Tell me if I'm on to something here...

In shared mode, I would like the user to input the criteria in the criteria range (specified in the macro code) and then run the macro. Could it be that you cannot enter new criteria in shared mode?

OR

Could excel have a problem running macros with advancefilter functions while in shared mode?
 
Here's what help states about shared workbook restrictions...
Code:
The following features can't be changed after a workbook is shared: merged cells, conditional formats, data validation, charts, pictures, objects including drawing objects, hyperlinks, scenarios, outlines, subtotals, data tables, PivotTable reports, workbook and worksheet protection, and macros.
So Criteria Values ought to be able to be changed.

If you care to, I'll look at your workbook if you send it to me -- san any confidential info.


Skip,
Skip@TheOfficeExperts.com
 
bump...anyone have anything to add to help me out? any help would be appreciated.

thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top