+ Reply to Thread
Results 1 to 4 of 4

want to create utility for excel sheet!!!!!

  1. #1
    .NetProf
    Guest

    want to create utility for excel sheet!!!!!

    Hi Grp,

    I want to create an utility for uploading data ( data which needs to be
    fetched from any database)onto the excel sheet and after making changes into
    the data, i also want it to store the chages into database. Is there a way
    to create a addin sort of thing which would be available in excel menu( say
    addin name is "Upload Data" ) and after clicking that addin all the data
    gets uploaded onto the excel sheet. Once the data gets uploaded, addin name
    gets change to "Save Data" and after clickin it, it should save the changes
    to database.

    Waiting for reply...

    -Deepak



  2. #2
    Bob Phillips
    Guest

    Re: want to create utility for excel sheet!!!!!

    Yes it is certainly possible. What you need is an addin with a custom menu.
    Like this

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    On Error Resume Next
    Application.CommandBars("Worksheet Menu Bar") _
    .Controls("Data Manager").Delete
    On Error GoTo 0
    End Sub

    Private Sub Workbook_Open()
    Dim oCb As CommandBar
    Dim oCtl As CommandBarPopup
    Dim oCtlBtn As CommandBarButton

    On Error Resume Next
    Application.CommandBars("Worksheet Menu Bar") _
    .Controls("Data Manager").Delete
    On Error GoTo 0

    Set oCb = Application.CommandBars("Worksheet Menu Bar")
    With oCb
    Set oCtl = .Controls.Add(Type:=msoControlPopup, _
    temporary:=True)
    oCtl.Caption = "Data Manager"
    With oCtl
    Set oCtlBtn = .Controls.Add( _
    Type:=msoControlButton, _
    temporary:=True)
    oCtlBtn.Caption = "Upload Data"
    oCtlBtn.OnAction = "Upload"
    End With
    With oCtl
    Set oCtlBtn = .Controls.Add( _
    Type:=msoControlButton, _
    temporary:=True)
    oCtlBtn.Caption = "Save Data"
    oCtlBtn.OnAction = "SaveData"
    End With
    'etc.
    End With
    End Sub

    'To add this, go to the VB IDE (ALT-F11 from Excel), and in
    'the explorer pane, select your workbook. Then select the
    'ThisWorkbook object (it's in Microsoft Excel Objects which
    'might need expanding). Double-click the ThisWorkbook and
    'a code window will open up. Copy this code into there,
    'changing the caption and action to suit.



    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    ".NetProf" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Grp,
    >
    > I want to create an utility for uploading data ( data which needs to be
    > fetched from any database)onto the excel sheet and after making changes

    into
    > the data, i also want it to store the chages into database. Is there a way
    > to create a addin sort of thing which would be available in excel menu(

    say
    > addin name is "Upload Data" ) and after clicking that addin all the data
    > gets uploaded onto the excel sheet. Once the data gets uploaded, addin

    name
    > gets change to "Save Data" and after clickin it, it should save the

    changes
    > to database.
    >
    > Waiting for reply...
    >
    > -Deepak
    >
    >




  3. #3
    .NetProf
    Guest

    Re: want to create utility for excel sheet!!!!!

    Thanks Bob.
    I got the logic which u ve implemented but I am facing pb. while
    implementing the same logic using c#.
    So could you plse provide me a logic or any site ptr where I can get c#
    code.

    -Deepak
    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > Yes it is certainly possible. What you need is an addin with a custom

    menu.
    > Like this
    >
    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > On Error Resume Next
    > Application.CommandBars("Worksheet Menu Bar") _
    > .Controls("Data Manager").Delete
    > On Error GoTo 0
    > End Sub
    >
    > Private Sub Workbook_Open()
    > Dim oCb As CommandBar
    > Dim oCtl As CommandBarPopup
    > Dim oCtlBtn As CommandBarButton
    >
    > On Error Resume Next
    > Application.CommandBars("Worksheet Menu Bar") _
    > .Controls("Data Manager").Delete
    > On Error GoTo 0
    >
    > Set oCb = Application.CommandBars("Worksheet Menu Bar")
    > With oCb
    > Set oCtl = .Controls.Add(Type:=msoControlPopup, _
    > temporary:=True)
    > oCtl.Caption = "Data Manager"
    > With oCtl
    > Set oCtlBtn = .Controls.Add( _
    > Type:=msoControlButton, _
    > temporary:=True)
    > oCtlBtn.Caption = "Upload Data"
    > oCtlBtn.OnAction = "Upload"
    > End With
    > With oCtl
    > Set oCtlBtn = .Controls.Add( _
    > Type:=msoControlButton, _
    > temporary:=True)
    > oCtlBtn.Caption = "Save Data"
    > oCtlBtn.OnAction = "SaveData"
    > End With
    > 'etc.
    > End With
    > End Sub
    >
    > 'To add this, go to the VB IDE (ALT-F11 from Excel), and in
    > 'the explorer pane, select your workbook. Then select the
    > 'ThisWorkbook object (it's in Microsoft Excel Objects which
    > 'might need expanding). Double-click the ThisWorkbook and
    > 'a code window will open up. Copy this code into there,
    > 'changing the caption and action to suit.
    >
    >
    >
    > --
    >
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from the email address if mailing direct)
    >
    > ".NetProf" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi Grp,
    > >
    > > I want to create an utility for uploading data ( data which needs to be
    > > fetched from any database)onto the excel sheet and after making changes

    > into
    > > the data, i also want it to store the chages into database. Is there a

    way
    > > to create a addin sort of thing which would be available in excel menu(

    > say
    > > addin name is "Upload Data" ) and after clicking that addin all the data
    > > gets uploaded onto the excel sheet. Once the data gets uploaded, addin

    > name
    > > gets change to "Save Data" and after clickin it, it should save the

    > changes
    > > to database.
    > >
    > > Waiting for reply...
    > >
    > > -Deepak
    > >
    > >

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: want to create utility for excel sheet!!!!!

    Sorry not me, I don't do c#.

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    ".NetProf" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Bob.
    > I got the logic which u ve implemented but I am facing pb. while
    > implementing the same logic using c#.
    > So could you plse provide me a logic or any site ptr where I can get c#
    > code.
    >
    > -Deepak
    > "Bob Phillips" <[email protected]> wrote in message
    > news:[email protected]...
    > > Yes it is certainly possible. What you need is an addin with a custom

    > menu.
    > > Like this
    > >
    > > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > > On Error Resume Next
    > > Application.CommandBars("Worksheet Menu Bar") _
    > > .Controls("Data Manager").Delete
    > > On Error GoTo 0
    > > End Sub
    > >
    > > Private Sub Workbook_Open()
    > > Dim oCb As CommandBar
    > > Dim oCtl As CommandBarPopup
    > > Dim oCtlBtn As CommandBarButton
    > >
    > > On Error Resume Next
    > > Application.CommandBars("Worksheet Menu Bar") _
    > > .Controls("Data Manager").Delete
    > > On Error GoTo 0
    > >
    > > Set oCb = Application.CommandBars("Worksheet Menu Bar")
    > > With oCb
    > > Set oCtl = .Controls.Add(Type:=msoControlPopup, _
    > > temporary:=True)
    > > oCtl.Caption = "Data Manager"
    > > With oCtl
    > > Set oCtlBtn = .Controls.Add( _
    > > Type:=msoControlButton, _
    > > temporary:=True)
    > > oCtlBtn.Caption = "Upload Data"
    > > oCtlBtn.OnAction = "Upload"
    > > End With
    > > With oCtl
    > > Set oCtlBtn = .Controls.Add( _
    > > Type:=msoControlButton, _
    > > temporary:=True)
    > > oCtlBtn.Caption = "Save Data"
    > > oCtlBtn.OnAction = "SaveData"
    > > End With
    > > 'etc.
    > > End With
    > > End Sub
    > >
    > > 'To add this, go to the VB IDE (ALT-F11 from Excel), and in
    > > 'the explorer pane, select your workbook. Then select the
    > > 'ThisWorkbook object (it's in Microsoft Excel Objects which
    > > 'might need expanding). Double-click the ThisWorkbook and
    > > 'a code window will open up. Copy this code into there,
    > > 'changing the caption and action to suit.
    > >
    > >
    > >
    > > --
    > >
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from the email address if mailing direct)
    > >
    > > ".NetProf" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi Grp,
    > > >
    > > > I want to create an utility for uploading data ( data which needs to

    be
    > > > fetched from any database)onto the excel sheet and after making

    changes
    > > into
    > > > the data, i also want it to store the chages into database. Is there a

    > way
    > > > to create a addin sort of thing which would be available in excel

    menu(
    > > say
    > > > addin name is "Upload Data" ) and after clicking that addin all the

    data
    > > > gets uploaded onto the excel sheet. Once the data gets uploaded, addin

    > > name
    > > > gets change to "Save Data" and after clickin it, it should save the

    > > changes
    > > > to database.
    > > >
    > > > Waiting for reply...
    > > >
    > > > -Deepak
    > > >
    > > >

    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1