Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Compile Error! Can't find project or Library --- Help!

Dear Colleagues;

I think I came across the same problem long time ago but I do not remember
how I got away with it at that time.

In the code below. The compiler stops at --Format(DateSerial(1, i, 1).,
"mmmm")

It seems that the compiler doesn't recognize "Format", even though I
referenced "Visual Basic for Applications" library. And when I browse the
objects with the Object Browser, I can see clearly that Format is under VBA
library.

Please tell me what to do to solve this problem.


Sub Demo1()
Dim Ops(1 To 12) As String
Dim i As Integer
Dim UserChoice As Variant
' Create an array of month names
For i = 1 To 12
Ops(i) = Format(DateSerial(1, i, 1), "mmmm")
Next i
UserChoice = GetOption(Ops, 1, "Select a month")
If UserChoice = False Then
Range("A6") = ""
Else
Range("A6") = Ops(UserChoice)
End If
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Compile Error! Can't find project or Library --- Help!

Go to the VB IDE, menu ToolsReferences and see if there are any missing
links in the references. If there are, uncheck them, and scroll down to find
the equivalent library, which will have a different version number, and
check that.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Suh Suk Ho" wrote in message
news:2a9NgB7TDHA.261@newsgroup...
Dear Colleagues;

I think I came across the same problem long time ago but I do not remember
how I got away with it at that time.

In the code below. The compiler stops at --Format(DateSerial(1, i, 1).,
"mmmm")

It seems that the compiler doesn't recognize "Format", even though I
referenced "Visual Basic for Applications" library. And when I browse the
objects with the Object Browser, I can see clearly that Format is under

VBA
library.

Please tell me what to do to solve this problem.


Sub Demo1()
Dim Ops(1 To 12) As String
Dim i As Integer
Dim UserChoice As Variant
' Create an array of month names
For i = 1 To 12
Ops(i) = Format(DateSerial(1, i, 1), "mmmm")
Next i
UserChoice = GetOption(Ops, 1, "Select a month")
If UserChoice = False Then
Range("A6") = ""
Else
Range("A6") = Ops(UserChoice)
End If
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Compile Error! Can't find project or Library --- Help!

I think this is what you're after, but I did take the
liberty of removing the array...hope this helps:

Sub Demo1()
Dim i As Integer
Dim UserChoice As Variant
For x = 1 To 12
xMonth = Format(DateSerial(1, x, 1), "MMM")
xMsg = xMsg & x & ". " & xMonth & vbCr
Next x
UserChoice = InputBox(Prompt:="Select a month:" & vbCr
& xMsg, Default:=1)
If UserChoice = False Then
Range("A6") = ""
Else
Range("A6") = UserChoice
End If
End Sub

-----Original Message-----
Dear Colleagues;

I think I came across the same problem long time ago but

I do not remember
how I got away with it at that time.

In the code below. The compiler stops at --Format

(DateSerial(1, i, 1).,
"mmmm")

It seems that the compiler doesn't recognize "Format",

even though I
referenced "Visual Basic for Applications" library. And

when I browse the
objects with the Object Browser, I can see clearly that

Format is under VBA
library.

Please tell me what to do to solve this problem.


Sub Demo1()
Dim Ops(1 To 12) As String
Dim i As Integer
Dim UserChoice As Variant
' Create an array of month names
For i = 1 To 12
Ops(i) = Format(DateSerial(1, i, 1), "mmmm")
Next i
UserChoice = GetOption(Ops, 1, "Select a month")
If UserChoice = False Then
Range("A6") = ""
Else
Range("A6") = Ops(UserChoice)
End If
End Sub


.

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: Can't find project or library Melanie New Users to Excel 14 August 21st 09 02:54 AM
Can't Find Project or Library Error Vick Excel Discussion (Misc queries) 1 May 17th 08 12:25 PM
can't find project or library - error Chris T-M New Users to Excel 4 January 18th 07 10:23 PM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
microsoft visual basic compile error can't find library mamabuff Setting up and Configuration of Excel 1 December 29th 05 11:19 AM


All times are GMT +1. The time now is 12:31 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"