Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Running macros it returns compile error in hidden module

Hi,
I have several macros in personal.xls, what is shared with other people
on network drive. Till some time all worked well without problems, bet
then started problems for some computers (some working perfectly,
computers running Office XP and Office 2003, but problem is on both
verions ). Problem is when running macros it returns that "compile
error in hidden module".

Problem is only in macros what works with links:
1) breaks workbooks links to other workbooks
2) opens new outlook mail message and copy link to excel workbook
(workbook is saved on server)

Other macros is working ok (saving all as values)

Could some one help? Should I reinstall Office for those computers or
what else?

One macros what doesn't work:
Sub MailIt()
' creates and sends a new e-mail message with Outlook
Dim OLF As Outlook.MAPIFolder, olMailItem As Outlook.MailItem
Dim cels, nosaukums, cels1, nosaukums1 As String
cels1 = ActiveWorkbook.fullname
nosaukums1 = ActiveWorkbook.Name
cels = Replace(cels1, " ", "%20")
nosaukums = Replace(nosaukums1, " ", "%20")
Set OLF = GetObject("", _

"Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderInbox)
Set olMailItem = OLF.Items.Add ' creates a new e-mail message
With olMailItem
.Subject = nosaukums ' message subject
.Body = "file:///" & cels & Chr(13)
' the message text with a line break
.OriginatorDeliveryReportRequested = False ' delivery
confirmation
.ReadReceiptRequested = False ' read confirmation
'.Save ' saves the message for later editing
'.Send ' sends the e-mail message (puts it in the Outbox)
End With
olMailItem.Display
Set olMailItem = Nothing
Set OLF = Nothing

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Running macros it returns compile error in hidden module

My guess is that since you're using different versions of office and you have a
reference set to Outlook (a reference to a specific version of outlook at
that!), that this is the problem. You may want to use late binding to just use
the most current version that the user has.

You may want to look at these links that Tom Ogilvy posted recently:

Here are some more extensive references on binding:

Use late binding - don't have a reference to excel.

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever Possible

and Dick Kusleika has a web page at:
http://www.dicks-clicks.com/excel/olBinding.htm
that explains this with Outlook

wrote:

Hi,
I have several macros in personal.xls, what is shared with other people
on network drive. Till some time all worked well without problems, bet
then started problems for some computers (some working perfectly,
computers running Office XP and Office 2003, but problem is on both
verions ). Problem is when running macros it returns that "compile
error in hidden module".

Problem is only in macros what works with links:
1) breaks workbooks links to other workbooks
2) opens new outlook mail message and copy link to excel workbook
(workbook is saved on server)

Other macros is working ok (saving all as values)

Could some one help? Should I reinstall Office for those computers or
what else?

One macros what doesn't work:
Sub MailIt()
' creates and sends a new e-mail message with Outlook
Dim OLF As Outlook.MAPIFolder, olMailItem As Outlook.MailItem
Dim cels, nosaukums, cels1, nosaukums1 As String
cels1 = ActiveWorkbook.fullname
nosaukums1 = ActiveWorkbook.Name
cels = Replace(cels1, " ", "%20")
nosaukums = Replace(nosaukums1, " ", "%20")
Set OLF = GetObject("", _

"Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderInbox)
Set olMailItem = OLF.Items.Add ' creates a new e-mail message
With olMailItem
.Subject = nosaukums ' message subject
.Body = "file:///" & cels & Chr(13)
' the message text with a line break
.OriginatorDeliveryReportRequested = False ' delivery
confirmation
.ReadReceiptRequested = False ' read confirmation
'.Save ' saves the message for later editing
'.Send ' sends the e-mail message (puts it in the Outbox)
End With
olMailItem.Display
Set olMailItem = Nothing
Set OLF = Nothing

End Sub


--

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
compile error in hidden module Wanna Learn Excel Discussion (Misc queries) 3 May 26th 09 08:57 PM
Compile error in hidden module Totte Excel Programming 4 May 19th 06 11:35 AM
Compile Error in Hidden Module: [email protected] Setting up and Configuration of Excel 2 September 16th 05 02:50 AM
compile error in hidden module Paul B[_7_] Excel Programming 2 December 12th 03 06:13 PM
Compile error in hidden module Paul Excel Programming 3 November 17th 03 09:56 PM


All times are GMT +1. The time now is 07:12 PM.

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"