View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default two unaswered questions, Could you answer me one or the two of the

filo666-

I've got a worksheet that does what you are looking for in your first
worksheet. I have a sheet called "File Info". All the code for this goes in
the ThisWorkbook. The code below in the workbook_activate event records the
toolbars that are open in Column A then hides them. The code in the
workbook_deactivate shows the toolbars that have been listed in the File Info
sheet. This should toggle the code when you switch workbooks, also shouldn't
matter how they are opened. Make sure you change workbook and sheet names
below as needed to fit your project.

Private Sub Workbook_Activate()
Dim TBarCount As Integer
Dim cbar As CommandBar
On Error Resume Next
'Removes Toolbars
Sheets("File info").Range("A:A").ClearContents
TBarCount = 0
For Each cbar In Application.CommandBars
If cbar.Type = msoBarTypeNormal Then
If cbar.Visible Then
TBarCount = TBarCount + 1
Workbooks("My workbook").Sheets("File
info").Cells(TBarCount, 1) = _
cbar.Name
cbar.Visible = False
End If
End If
Next cbar
''''This also hides the formula bar, status bar, and scroll bars.
''''Uncomment if you want to use
' With Application
' .DisplayFormulaBar = False
' .DisplayStatusBar = False
' .DisplayScrollBars = False
' End With
End Sub

Private Sub Workbook_Deactivate()
Dim Row As Long
Dim TBar As String

Row = 1
TBar = Workbooks("My Workbook.xls").Sheets("File info").Cells(Row, 1)
Do While TBar < ""
Application.CommandBars(TBar).Visible = True
Row = Row + 1
TBar = Workbooks("My workbook.xls").Sheets("File info").Cells(Row, 1)
Loop
''''Unhides the formula bar, status bar, and scroll bars.
''''Uncomment if you would like to use
' With Application
' .DisplayFormulaBar = True
' .DisplayStatusBar = True
' .DisplayScrollBars = True
' End With
End Sub



"filo666" wrote:

1.
Hi, I'm tryng to accomplish something difficult to explain:
If you open a workbook (ex. hello.xls) and the you go to file--open another
file (ex. hello2.xls) then you have hello.xls and hello2.xls in the same
excel window, but if you open hello.xls ant then you go to the excels general
icon (the one that opens an excel window with a new woorkbook on it) ant
then you choose file--open hello2.xls then you have 2 excel windows, now my
problem: I have my firs book hello.xls with all the menu bars disabled but
the woorkbook hello2.xls needs all the menu bars enabled so if I open my
workbook as explained on the second way to open the file I can have my file
hello.xls without the menu bars and hello2.xls with all the menu bars
enabled; BUT I NEED TO OPEN EXCELS GENERAL ICON TO ACHIVE THIS, I mean, I
cant paste a shortcut in the desktop because when I open the second file, it
opens in the excels window of my first file.
It's very important that the user of my program could open the file from the
desktop, so there is a way to do what I want?????
Hope this have sence, TIA

2.
Hi, I learn how to get information from internet to excel, so the information
is refreshed every x minutes, whatI need to do is to fill from excel to
internet information.
There is an internet page (www.telcel.com) that allow users to send SMS for
free, you just need to type your mesage and the phone number and press the
send key (enviar because it's a Mexican page), what I want to do via excel is:

blablabla
If cells(2,2) <400 then
'' Send the mesage in cells(5,6) to the phone number in cells(3,4)''
elseif cells(2,2)200 and cells(2,2)<300 then
'' Send the mesage in cells(5,6) to the phone number in cells(5,4)''
else
'' Send the mesage in cells(5,6) to the phone number in cells(7,4)''
end if
blablabla
And also I'ld like to know if I can fill the textboxes of yahoo or hotmail
via VBA-Excel
Any help will be appresiate
TIA