|
I tried Excel Package (OpenOfficeXML) instead of Office COM dlls and it worked fine for my needs -
thanks for your help.
|
|
|
|
|
Oh, and one more thing. The code is never interpreted when running in the debugger. It's always compiled into an .executable and launched.
|
|
|
|
|
I am using the progress bar supplied with VB 2013 - everything works as it should except that the "flying left to right highlight animation" does not work - the moving bar is just the flat solid colour. On the designer I see the "highlight flying" effect but not when I run or test the .exe file! I have searched everywhere for any clues and so far hit a blank wall. Is there some property I should be setting on the progress bar to achieve this? Any clue would be appreciated.
All the best and TIA.
HotBlue
|
|
|
|
|
What operating system?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Sorry - I should have included this. I used Win 7, 8.1 and 10 with Framework 4.0 - all gave the same results, flat colour and no highlight fly by.
|
|
|
|
|
How are you updating the progress bar?
|
|
|
|
|
The bar updates when an action has completed within a loop thus:
; Initialise
frm_Splash.bar_Loading.Width = 390
ffrm_Splash.bar_Loading.Maximum = 39
rm_Splash.bar_Loading.Style = ProgressBarStyle.Continuous
frm_Splash.bar_Loading.Enabled = True
frm_Splash.bar_Loading.Visible = True
frm_Splash.bar_Loading.Value = 0
ActionLevel = 0
; Working loop.
For I = 0 to 39
; ... working code here.
ActionLevel += 1 ; Advance Progress Bar.
frm_Splash.bar_Loading.Value = ActionLevel
Application.DoEvents()
Next
The bar progresses normally but no highlight "flyby" animation.
|
|
|
|
|
|
Thanks - tried both - still no "fly-across"!
|
|
|
|
|
I do not think you will see any changes since your progress bar is most likely not being updated as you expect. You need to create a background thread that updates the control as your application progresses or processes some data.
|
|
|
|
|
Did you set the "marquis" style?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I set the marquis to De Sade but that just hurt the program!
My .style setting is "continuous" which only gives a solid colour with no "fly by".
|
|
|
|
|
i'm trying to locate a file inside a textbox (full path i.e. "I:\movie collections\Gigantic - 2008 - Zooey Dechanel.mp4" = MovieURLTextbox.text) and display it in windows explorer. below code works fine with short filenames but would go to the default mydocuments with long filenames. please help... thnx!
Dim fileToFind As String
fileToFind = MovieURLTextBox.Text
Call Shell("explorer /select," & fileToFind, AppWinStyle.NormalFocus)
modified 4-Oct-15 2:58am.
|
|
|
|
|
What does this mean, exactly?
Member 12029698 wrote: but would go to the default mydocuments with long filenames
Did you try putting quotes around the long filename?
fileToFind = """" & fileToFind & """"
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
thnx...
I meant with long filenames, the code would take me to "my computer" (not "my documents", my bad);
e.g.
I:\movie collections\Me and Earl and the Dying Girl - 2015 - Thomas Mann, RJ Cyler, Olivia Cooke.mkv
while, "I:\movie collections\Gigantic - 2008 - Zooey Dechanel.mp4" will do as the code is intended
|
|
|
|
|
I think it's the presence of the "comma" in the path... I tried removing the "comma" and the code works fine.
|
|
|
|
|
finally made it worked with code below;
Dim filePath As String = MovieURLTextBox.Text
Try
Process.Start("Explorer.exe", "/n,/e,/select, """ & filePath & """")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
looks like process.start and the double quotes on the file path was the solution to my problem.
hope this can help others too...
|
|
|
|
|
Good day friends! I need your help in this issue. I know vb6 is outdated but this has to be done in vb6. I add ms access database to a resource file in my vb6 app but am finding it difficult to add new record, search the database, delete record from it etc. How can I achieved this in vb6 resource file. Thanks in advance!
|
|
|
|
|
You cannot use an Access database from inside a resource in any language at all.
An Access database MUST be a file on disk in order to be usable. The user running the code must also have Read and Write access to the database file in order to work.
|
|
|
|
|
|
I have two workbooks that I am working with. I am trying to copy a range of cells from one workbook to another. The source workbook will already be open and the destination workbook might not be open all the time. I am a little new at VBA. I have looked at some code from different sources on this topic. This is what I have so far.
I get the following Compiler Error: Invalid use of property
This happens when trying to open the destination workbook.
Sub export_data()
'
'
'Delcare variables
Dim xlApp As New Excel.Application
Dim xlworkbook1, xlworkbook2 As Excel.Workbooks
Dim xlworksheet1, xlworksheet2 As Excel.Worksheets
Dim xlSourceRange, xlDestRange As Excel.Range
'Set the source workbook
xlworkbook1 = xlApp.Workbooks.Open("C:\Users\Michael\Documents\Greystone\GDI Line\Holey Paper Templates\Denso GDI Holey Paper Rev 5.xls")
'Open destination workbook
xlworkbook2 = xlApp.Workbooks.Open("C:\Users\Michael\Documents\Greystone\GDI Line\Denso GDI (Hitachi Templates 7.9.2015)\Hitachi 1.xlsm")
'Display Excel
xlApp.Visible = True
'Set the source active worksheet
If xlworksheet1 = Worksheets("GDI Connector").Activate Then
xlworksheet1 = xlworkbook1.Sheets("GDI Connector")
Else
xlworksheet1 = xlworkbook.Sheets("GDI Core")
End If
'Set the destination worksheet
xlworksheet2 = xlworkbook2.Sheets("Export")
'Set the source range
xlSourceRange = xlWorkSheet.Range("F1:F120")
'Set the destination range
xlDestRange = xlWorkSheet.Range("B34")
'Copy and past the range
xlSourceRange.Copy = (xlDestRange)
'
Application.Goto Reference:="export_data"
ActiveWorkbook.Save
End Sub
Any help would be much appreciated.
|
|
|
|
|
Haven't had a chance to check this out yet but could it be
Dim xlworkbook1, xlworkbook2 As Excel.Workbooks - The Open method returns a Workbook not a Workbooks collection.
|
|
|
|
|
That was not it. Thanks for the suggestion. I am getting a "Runtime error 13" Type Mismatch on the line Set xlWorkSheet1 = ActiveWorksheet
There are 2 possible worksheets that could be the active one so I am trying to check which one is currently active.
Function GetThisWB() As String
GetThisWB = ThisWorkbook.Path & "\" & ThisWorkbook.Name
End Function
Public Sub export_data()
'
'
'Delcare variables
Dim xlApp As New Excel.Application
Dim xlWorkBook1 As Excel.Workbooks
Dim xlWorkBook2 As Excel.Workbooks
Dim xlWorkSheet1 As Excel.Worksheets
Dim xlWorkSheet2 As Excel.Worksheets
Dim xlworksheet3 As Excel.Worksheets
Dim xlSourceRange As Excel.Range
Dim xlDestRange As Excel.Range
'
'Set source workbook as active
'
'Display Excel
xlApp.Visible = True
''Set the source active worksheet
'
If Worksheets("GDI Connector").Activate = True Then
Set xlWorkSheet1 = ActiveSheet
ElseIf Worksheets("GDI Core").Activate = True Then
Set xlWorkSheet2 = ActiveSheet
End If
'Set the source range
xlSourceRange = xlWorkSheets.Range("F1:F120")
xlSourceRange.Copy
'Open workbook 2 and set the destination worksheet as active
Workbooks.Open ("C:\Users\Michael\Documents\Greystone\GDI Line\Denso GDI (Hitachi Templates 7.9.2015)")
xlworksheet3("Export").Select
'Set the destination range
xlDestRange = xlWorkSheets.Range("B34")
'Copy and paste the range
xlDestRange.PasteSpecial
'
Application.Goto Reference:="export_data"
ActiveWorkbook.Save
End Sub
|
|
|
|
|
Again, ActiveWorkSheet returns a WorkSheet object but you have defined
Dim xlWorkSheet1 As Excel.Worksheets
|
|
|
|
|
I have a problem in my programming class. A person gets paid daily, day one is 1 penny, day two is 2 pennies, day three is 4 pennies, day five is 8 pennies and so on doubling each day. I wrote the following code but am having an issue with out put. When I put in 1 day it tells me 2 pennies instead of 1. I am sure this is an easy fix but my brain is fried and I am overlooking it.
Here is my code:
Public Class Form1
Private Sub calculateButton_Click(sender As Object, e As EventArgs) Handles calculateButton.Click
Dim intDays As Integer
intDays = 1
Dim decPennies As Decimal
decPennies = 0.01
For intDays = 1 To cboDays.Text
decPennies = decPennies * 2
Next intDays
ansLabel.Text = decPennies.ToString("C")
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For intDays = 1 To 20
cboDays.Items.Add(intDays)
Next
End Sub
End Class
Any help would be greatly appreciated.
|
|
|
|