|
-
Oct 5th, 2009, 06:32 AM
#1
Thread Starter
New Member
Run-time error 91
Hi,
I am not experienced at all when it comes to excel and VB, but I am working in a Excel sheet inserted into a pp where I need to record a macro for a simple "sort list" execution (this is meant for people in my organization to enter info and then be able to click a button to sort the info they have entered).
Now, when I am recording the macro it works fine while I keep the document opened - but as save the pp presentation and close the excel sheet and the pp presentation and open it up again the macro does not work. The text saying this comes up:
"Cannot run the macro"worksheet in Segmentation HW Acc 2010 V8.1(Compability Mode)'!sortlist'. The macro may not be available in this worksheet or all macros may be disabled."
When I look into the module and debug it says:
Code:
Sub sortlist()
'
' sortlist Macro
'
'
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort.SortFields.Add Key:=Range _
("C3:C46"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
I would be so happy to get some help on this, since I am not that experienced and it is not easy for me to understand. Thank you all!
-
Oct 5th, 2009, 06:35 AM
#2
Re: Run-time error 91
Moved To Office Development
-
Oct 5th, 2009, 07:28 AM
#3
Re: Run-time error 91
Welcome to the forums 
Please help us with two things.
1) Which Excel and PP version are you using?
2) Can you attach a sample file/snapshot of the error?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 6th, 2009, 03:21 AM
#4
Re: Run-time error 91
Sounds like Macros may be disabled. Go to Tools > Macro > Security and set the level to Meduim. This will allow you to choose to run macros or not when the office app is run. If you have 2007 or newer then its in the Office button > Options.
Also, why is it in "Compatibility Mode"?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|