PDA

View Full Version : hiding button when save



coxonitus
05-02-2011, 07:04 AM
hi guys,
here i'am again.
i'm using this code below.

' Dim exemplaar As String
exemplaar = Application.InputBox(Title:=UCase("Wat moet er gebeuren ?"), prompt:="* Document opslaan en afsluiten ? = Antwoord : Ja" & vbLf & "* Pagina afdrukken, geef aantal exemplaren :" & vbLf & "* niets doen : antwoord A", Default:="1", Type:=2)
Select Case UCase(exemplaar)
Case "", "A": MsgBox "je hebt op annuleren gedrukt"
Case "JA":
ActiveSheet.Copy
Range("K:L,M:N:O:P:Q:R").Select
Selection.EntireColumn.Hidden = True
Application.EnableEvents = True
ActiveSheet.SaveAs "G:\Project\Temp.File\Brandstofverbruik" & SheetName & ".xls"
ActiveWindow.Close

Case Else
If IsNumeric(exemplaar) Then
If CInt(exemplaar) > 0 Then ActiveSheet.printout Copies:=CInt(exemplaar), Preview:=False
End If

End Select
End Sub

when you look at my zip file u see 2 buttons, when i give command save, it has to hide columns en the 2 buttons, to copy en saving it as xls.file.
everything works except hiding the buttons.

anyone

Bob Phillips
05-02-2011, 07:57 AM
Why the second post on the same topic?

coxonitus
05-02-2011, 10:04 AM
sorry guys,
i was posting double, so one can be removed.

the question has been already solved.
i will post a new one, that involves an option excplicit when opening file...
that had to be the actual second post.

sorry XLD, thnx for reminding me